# feiyull/tensorrt-alpha architecture

> Architecture diagram of the GitHub repository feiyull/tensorrt-alpha, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/feiyull/tensorrt-alpha
- Repository: https://github.com/feiyull/tensorrt-alpha

## Overview

TensorRT-Alpha is a collection of CUDA/TensorRT computer-vision inference examples, not a single model service. Its principal workflow accepts batched images or video frames, preprocesses them, runs a TensorRT engine, decodes and suppresses detections, then displays or saves results. The repository also includes segmentation, pose, face detection, and saliency examples. README statements describe the shared processing stages; sampled code confirms several model-specific implementations and the YOLO base class. Some model connections are dashed where their application call paths were not excerpted.

Main entry points: [`utils/yolo.cpp`](https://github.com/feiyull/tensorrt-alpha/blob/main/utils/yolo.cpp) (YOLO runtime base), [`yolov5/app_yolov5.cpp`](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov5/app_yolov5.cpp) (YOLO applications), [`yolov8-pose/yolov8_pose.cpp`](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8-pose/yolov8_pose.cpp) (YOLOv8 pose), [`yolov8-seg/yolov8_seg.cpp`](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8-seg/yolov8_seg.cpp) (YOLOv8 segmentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Inference Runtime"]
  node_yolo_base["YOLO runtime base<br/>[yolo.cpp]"]
  node_onnx_engine["TensorRT engine"]
  node_result_output["Display or save<br/>[utils.cpp]"]
end

subgraph group_detection["Object Detection"]
  node_yolo_apps["YOLO applications<br/>[app_yolov5.cpp]"]
  node_yolo_models["YOLO model variants"]
  node_yolov8_model["YOLOv8 detector<br/>[yolov8.cpp]"]
  node_yolonas_model["YOLO-NAS detector<br/>[yolo_nas.cpp]"]
  node_efficientdet["EfficientDet<br/>[efficientdet.cpp]"]
end

subgraph group_vision["Specialized Vision"]
  node_pose["YOLOv8 pose<br/>[yolov8_pose.cpp]"]
  node_segmentation["YOLOv8 segmentation<br/>[yolov8_seg.cpp]"]
  node_human_seg["Human segmentation<br/>[pphunmanseg.cpp]"]
  node_face_detection["Face detection<br/>[libfacedetection.h]"]
  node_saliency["Saliency detection<br/>[u2net.h]"]
  node_special_decoders["Task decoders"]
end

subgraph group_shared["CUDA Utilities"]
  node_cuda_preprocess["CUDA preprocessing<br/>[kernel_function.h]"]
  node_yolo_decode_nms["YOLO decode and NMS<br/>[yolo.cpp]"]
end

node_user(("Image or video source"))

node_user -->|"provides frames"| node_yolo_apps
node_yolo_apps -.->|"uses runtime"| node_yolo_base
node_yolo_apps -.->|"selects model"| node_yolo_models
node_yolo_apps -.->|"selects model"| node_yolov8_model
node_yolo_apps -.->|"selects model"| node_yolonas_model
node_yolo_base -.->|"preprocesses batches"| node_cuda_preprocess
node_yolo_base -.->|"executes engine"| node_onnx_engine
node_yolo_base -.->|"decodes detections"| node_yolo_decode_nms
node_yolo_base -.->|"returns results"| node_result_output
node_yolo_models -.->|"inherits runtime"| node_yolo_base
node_yolov8_model -.->|"inherits runtime"| node_yolo_base
node_yolonas_model -.->|"inherits runtime"| node_yolo_base
node_efficientdet -->|"preprocesses batches"| node_cuda_preprocess
node_user -.->|"provides frames"| node_efficientdet
node_user -.->|"provides frames"| node_pose
node_user -.->|"provides frames"| node_segmentation
node_user -.->|"provides frames"| node_human_seg
node_user -.->|"provides frames"| node_face_detection
node_user -.->|"provides frames"| node_saliency
node_pose -->|"inherits runtime"| node_yolo_base
node_segmentation -->|"uses decoder"| node_special_decoders
node_human_seg -->|"uses decoder"| node_special_decoders
node_pose -->|"applies NMS"| node_yolo_decode_nms
node_segmentation -->|"applies NMS"| node_yolo_decode_nms
node_user -.->|"provides frames"| node_yolo_models

click node_yolo_apps "https://github.com/feiyull/tensorrt-alpha/blob/main/yolov5/app_yolov5.cpp"
click node_yolo_base "https://github.com/feiyull/tensorrt-alpha/blob/main/utils/yolo.cpp"
click node_yolo_models "https://github.com/feiyull/tensorrt-alpha/tree/main/yolov3"
click node_yolov8_model "https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8/yolov8.cpp"
click node_yolonas_model "https://github.com/feiyull/tensorrt-alpha/blob/main/yolonas/yolo_nas.cpp"
click node_efficientdet "https://github.com/feiyull/tensorrt-alpha/blob/main/efficientdet/efficientdet.cpp"
click node_pose "https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8-pose/yolov8_pose.cpp"
click node_segmentation "https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8-seg/yolov8_seg.cpp"
click node_human_seg "https://github.com/feiyull/tensorrt-alpha/blob/main/pphumanseg/pphunmanseg.cpp"
click node_face_detection "https://github.com/feiyull/tensorrt-alpha/blob/main/libfacedetection/libfacedetection.h"
click node_saliency "https://github.com/feiyull/tensorrt-alpha/blob/main/u2net/u2net.h"
click node_cuda_preprocess "https://github.com/feiyull/tensorrt-alpha/blob/main/utils/kernel_function.h"
click node_yolo_decode_nms "https://github.com/feiyull/tensorrt-alpha/blob/main/utils/yolo.cpp"
click node_special_decoders "https://github.com/feiyull/tensorrt-alpha/blob/main/pphumanseg/decode_pphunmanseg.h"
click node_result_output "https://github.com/feiyull/tensorrt-alpha/blob/main/utils/utils.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_yolo_base,node_onnx_engine,node_result_output toneBlue
class node_yolo_apps,node_yolo_models,node_yolov8_model,node_yolonas_model,node_efficientdet toneAmber
class node_pose,node_segmentation,node_human_seg,node_face_detection,node_saliency,node_special_decoders toneMint
class node_cuda_preprocess,node_yolo_decode_nms toneRose
class node_user toneIndigo
```

## Components

### Inference Runtime

- [YOLO runtime base](https://github.com/feiyull/tensorrt-alpha/blob/main/utils/yolo.cpp): `utils/yolo.cpp`
- **TensorRT engine**
- [Display or save](https://github.com/feiyull/tensorrt-alpha/blob/main/utils/utils.cpp): `utils/utils.cpp`

### Object Detection

- [YOLO applications](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov5/app_yolov5.cpp): `yolov5/app_yolov5.cpp`
- [YOLO model variants](https://github.com/feiyull/tensorrt-alpha/tree/main/yolov3): `yolov3`
- [YOLOv8 detector](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8/yolov8.cpp): `yolov8/yolov8.cpp`
- [YOLO-NAS detector](https://github.com/feiyull/tensorrt-alpha/blob/main/yolonas/yolo_nas.cpp): `yolonas/yolo_nas.cpp`
- [EfficientDet](https://github.com/feiyull/tensorrt-alpha/blob/main/efficientdet/efficientdet.cpp): `efficientdet/efficientdet.cpp`

### Specialized Vision

- [YOLOv8 pose](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8-pose/yolov8_pose.cpp): `yolov8-pose/yolov8_pose.cpp`
- [YOLOv8 segmentation](https://github.com/feiyull/tensorrt-alpha/blob/main/yolov8-seg/yolov8_seg.cpp): `yolov8-seg/yolov8_seg.cpp`
- [Human segmentation](https://github.com/feiyull/tensorrt-alpha/blob/main/pphumanseg/pphunmanseg.cpp): `pphumanseg/pphunmanseg.cpp`
- [Face detection](https://github.com/feiyull/tensorrt-alpha/blob/main/libfacedetection/libfacedetection.h): `libfacedetection/libfacedetection.h`
- [Saliency detection](https://github.com/feiyull/tensorrt-alpha/blob/main/u2net/u2net.h): `u2net/u2net.h`
- [Task decoders](https://github.com/feiyull/tensorrt-alpha/blob/main/pphumanseg/decode_pphunmanseg.h): `pphumanseg/decode_pphunmanseg.h`

### CUDA Utilities

- [CUDA preprocessing](https://github.com/feiyull/tensorrt-alpha/blob/main/utils/kernel_function.h): `utils/kernel_function.h`
- [YOLO decode and NMS](https://github.com/feiyull/tensorrt-alpha/blob/main/utils/yolo.cpp): `utils/yolo.cpp`

### Other components

- **Image or video source**

## Connections

- Image or video source → YOLO applications: provides frames (evidence: `yolov5/app_yolov5.cpp`)
- YOLO applications → YOLO runtime base: uses runtime
- YOLO applications → YOLO model variants: selects model
- YOLO applications → YOLOv8 detector: selects model
- YOLO applications → YOLO-NAS detector: selects model
- YOLO runtime base → CUDA preprocessing: preprocesses batches
- YOLO runtime base → TensorRT engine: executes engine
- YOLO runtime base → YOLO decode and NMS: decodes detections (evidence: `utils/yolo.cpp`)
- YOLO runtime base → Display or save: returns results
- YOLO model variants → YOLO runtime base: inherits runtime
- YOLOv8 detector → YOLO runtime base: inherits runtime
- YOLO-NAS detector → YOLO runtime base: inherits runtime
- EfficientDet → CUDA preprocessing: preprocesses batches (evidence: `efficientdet/efficientdet.cpp`)
- Image or video source → EfficientDet: provides frames
- Image or video source → YOLOv8 pose: provides frames
- Image or video source → YOLOv8 segmentation: provides frames
- Image or video source → Human segmentation: provides frames
- Image or video source → Face detection: provides frames
- Image or video source → Saliency detection: provides frames
- YOLOv8 pose → YOLO runtime base: inherits runtime (evidence: `yolov8-pose/yolov8_pose.cpp`)
- YOLOv8 segmentation → Task decoders: uses decoder (evidence: `yolov8-seg/yolov8_seg.cpp`)
- Human segmentation → Task decoders: uses decoder (evidence: `pphumanseg/pphunmanseg.cpp`)
- YOLOv8 pose → YOLO decode and NMS: applies NMS (evidence: `yolov8-pose/yolov8_pose.cpp`)
- YOLOv8 segmentation → YOLO decode and NMS: applies NMS (evidence: `yolov8-seg/yolov8_seg.cpp`)
- Image or video source → YOLO model variants: provides frames
