Skip to content

Commit 9ea6918

Browse files
committed
update postprocess
1 parent a4ccfc8 commit 9ea6918

39 files changed

Lines changed: 910 additions & 468 deletions

README.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# TensorRT_Inference_Demo
2+
<div align="center">
3+
<img src="assets/000000005001.jpg" height="200px" >
4+
<img src="assets/000000007816.jpg" height="200px" >
5+
6+
</div>
27

38
<div align="center">
49

@@ -12,42 +17,43 @@ This repo use TensorRT-8.x to deploy well-trained models.
1217

1318
## 2.Update
1419

15-
- [x] [YOLOv5](https://github.com/ultralytics/yolov5)
20+
- [x] [YOLOv5](https://github.com/ultralytics/yolov5) (sd)
1621
- [x] [YOLOv5-seg](https://github.com/ultralytics/yolov5)
1722
- [x] [YOLOv7](https://github.com/WongKinYiu/yolov7)
1823
- [x] [YOLOv8](https://github.com/ultralytics/ultralytics)
19-
- [ ] [YOLOv8-seg](https://github.com/ultralytics/ultralytics)
24+
- [x] [YOLOv8-seg](https://github.com/ultralytics/ultralytics)
25+
2026

2127

2228
## 3.Support Models
29+
All speed tests were performed on RTX 3090 with COCO Val set.The time calculated here is the sum of the time of image preprocess, inference and postprocess, since image loading and visualizing are not counted in, the actual spedd will be a little slower.
2330

24-
| Models | Device | BatchSize | Mode | Input Shape(HxW) | FPS |
31+
| Models | BatchSize | Mode | Input Shape(HxW) | FPS* | FPS |
2532
|-|-|:-:|:-:|:-:|:-:|
26-
| YOLOv5-n v7.0 |RTX3090 | 1 | FP32 | 640x640 | 264 |
27-
| YOLOv5-s v7.0 |RTX3090 | 1 | FP32 | 640x640 | 210 |
28-
| YOLOv5-s v7.0 |RTX3090 | 32 | FP32 | 640x640 | - |
29-
| YOLOv5-m v7.0 |RTX3090 | 1 | FP32 | 640x640 | 140 |
30-
| YOLOv5-l v7.0 |RTX3090 | 1 | FP32 | 640x640 | 105 |
31-
| YOLOv5-x v7.0 |RTX3090 | 1 | FP32 | 640x640 | 75 |
32-
| YOLOv7 |RTX3090 | 1 | FP32 | 640x640 | 115 |
33-
| YOLOv7x |RTX3090 | 1 | FP32 | 640x640 | - |
34-
| YOLOv8-n |RTX3090 | 1 | FP32 | 640x640 | 222 |
35-
| YOLOv8-s |RTX3090 | 1 | FP32 | 640x640 | 171 |
36-
| YOLOv8-m |RTX3090 | 1 | FP32 | 640x640 | 122 |
37-
| YOLOv8-l |RTX3090 | 1 | FP32 | 640x640 | 88 |
38-
| YOLOv8-x |RTX3090 | 1 | FP32 | 640x640 | 68 |
39-
| RT-DETR |RTX3090 | 1 | FP32 | 640x640 | - |
40-
| RT-DETR |RTX3090 | 1 | FP32 | 640x640 | - |
41-
| SOLO(r50) |RTX3090 | 1 | FP32 | 480x640 | - |
42-
| SOLOv2(r50) |RTX3090 | 1 | INT8 | 480x640 | - |
43-
44-
## 4.Install
33+
| YOLOv5-n v7.0 | 1 | FP32 | 640x640 | 724 |
34+
| YOLOv5-s v7.0 | 1 | FP32 | 640x640 | 468 |
35+
| YOLOv5-s v7.0 | 32 | FP32 | 640x640 | - |
36+
| YOLOv5-m v7.0 | 1 | FP32 | 640x640 | 270 |
37+
| YOLOv5-l v7.0 | 1 | FP32 | 640x640 | 151 |
38+
| YOLOv5-x v7.0 | 1 | FP32 | 640x640 | 94 |
39+
| YOLOv7 | 1 | FP32 | 640x640 | 154 |
40+
| YOLOv7x | 1 | FP32 | 640x640 | - | - |
41+
| YOLOv8-n | 1 | FP32 | 640x640 | 390 | 127 |
42+
| YOLOv8-s | 1 | FP32 | 640x640 | 171 | 101 |
43+
| YOLOv8-m | 1 | FP32 | 640x640 | 122 |
44+
| YOLOv8-l | 1 | FP32 | 640x640 | 88 |
45+
| YOLOv8-x | 1 | FP32 | 640x640 | 68 |
46+
| RT-DETR | 1 | FP32 | 640x640 | - | - |
47+
| RT-DETR | 1 | FP32 | 640x640 | - | - |
48+
+ FPS* means that the time of image loading, image processing and visualization are taken into account when calculating.FPS only counts image processing time(preprocess, inference, postprocess).
49+
50+
## 4.Usage
4551
1. Clone the repo.
4652
```
4753
git clone https://github.com/Li-Hongda/TensorRT_Inference_Demo.git
4854
cd TensorRT_Inference_Demo/object_detection
4955
```
50-
2. Change the path [here]() to your TensorRT path, and [here]() to your CUDA path. Then,
56+
2. Change the path [here](https://github.com/Li-Hongda/TensorRT_Inference_Demo/blob/main/object_detection/CMakeLists.txt#L19) to your TensorRT path, and [here](https://github.com/Li-Hongda/TensorRT_Inference_Demo/blob/main/object_detection/CMakeLists.txt#L11) to your CUDA path. Then,
5157
```
5258
mkdir build && cd build
5359
cmake ..
@@ -56,6 +62,7 @@ make -j$(nproc)
5662
3. The executable file will be generated in `bin` in the repo directory if compile successfully.Then enjoy yourself with command like this:
5763
```
5864
cd bin
59-
./object_detection yolov5 /path/to/input/dir false
65+
./object_detection yolov5 /path/to/input/dir
6066
```
6167

68+

assets/000000005001.jpg

158 KB
Loading

assets/000000007816.jpg

130 KB
Loading

assets/000000007977.jpg

150 KB
Loading

configs/rtdetr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ rtdetr:
77
inputChannel: 3
88
imageWidth: 640
99
imageHeight: 640
10-
obj_threshold: 0.25
11-
nms_threshold: 0.45
10+
conf_thr: 0.25
11+
nms_thr: 0.45
1212
strides: [8, 16, 32]
1313
imgMean: [ 0, 0, 0 ]
1414
imgStd: [ 1, 1, 1 ]

configs/yolov5-seg.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ yolov5-seg:
77
inputChannel: 3
88
imageWidth: 640
99
imageHeight: 640
10-
obj_threshold: 0.25
11-
nms_threshold: 0.45
10+
conf_thr: 0.25
11+
nms_thr: 0.45
1212
strides: [8, 16, 32]
1313
imgMean: [ 0, 0, 0 ]
1414
imgStd: [ 1, 1, 1 ]

configs/yolov5.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ yolov5:
77
inputChannel: 3
88
imageWidth: 640
99
imageHeight: 640
10-
obj_threshold: 0.25
11-
nms_threshold: 0.45
10+
conf_thr: 0.25
11+
nms_thr: 0.45
1212
strides: [8, 16, 32]
1313
imgMean: [ 0, 0, 0 ]
1414
imgStd: [ 1, 1, 1 ]

configs/yolov7-p6.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ yolov7:
77
inputChannel: 3
88
imageWidth: 1280
99
imageHeight: 1280
10-
obj_threshold: 0.4
11-
nms_threshold: 0.45
10+
conf_thr: 0.4
11+
nms_thr: 0.45
1212
strides: [8, 16, 32, 64]
1313
imgMean: [ 0, 0, 0 ]
1414
imgStd: [ 1, 1, 1 ]

configs/yolov7.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
yolov7:
2-
onnx_file: "../weights/yolov7/yolov7x.onnx"
3-
engine_file: "../weights/yolov7/yolov7x.trt"
2+
onnx_file: "../weights/yolov7/yolov7.onnx"
3+
engine_file: "../weights/yolov7/yolov7.trt"
44
type: "coco80"
55
mode: "fp32"
66
batchSize: 1
77
inputChannel: 3
88
imageWidth: 640
99
imageHeight: 640
10-
obj_threshold: 0.25
11-
nms_threshold: 0.45
10+
conf_thr: 0.25
11+
nms_thr: 0.45
1212
strides: [8, 16, 32]
1313
imgMean: [ 0, 0, 0 ]
1414
imgStd: [ 1, 1, 1 ]

configs/yolov8-seg.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ yolov8-seg:
77
inputChannel: 3
88
imageWidth: 640
99
imageHeight: 640
10-
obj_threshold: 0.25
11-
nms_threshold: 0.45
10+
conf_thr: 0.25
11+
nms_thr: 0.45
1212
strides: [8, 16, 32]
1313
imgMean: [ 0, 0, 0 ]
1414
imgStd: [ 1, 1, 1 ]

0 commit comments

Comments
 (0)