GPU Batched NMS
This commit is contained in:
112
readme.md
112
readme.md
@@ -25,7 +25,7 @@ NVIDIA DeepStream SDK 6.1 / 6.0.1 / 6.0 configuration for YOLO models
|
||||
* YOLOR native support
|
||||
* Models benchmarks (**outdated**)
|
||||
* **GPU YOLO Decoder (moved from CPU to GPU to get better performance)** [#138](https://github.com/marcoslucianops/DeepStream-Yolo/issues/138)
|
||||
* **Improved NMS** [#142](https://github.com/marcoslucianops/DeepStream-Yolo/issues/142)
|
||||
* **GPU Batched NMS** [#142](https://github.com/marcoslucianops/DeepStream-Yolo/issues/142)
|
||||
|
||||
##
|
||||
|
||||
@@ -38,6 +38,7 @@ NVIDIA DeepStream SDK 6.1 / 6.0.1 / 6.0 configuration for YOLO models
|
||||
* [Basic usage](#basic-usage)
|
||||
* [YOLOv5 usage](#yolov5-usage)
|
||||
* [YOLOR usage](#yolor-usage)
|
||||
* [NMS configuration](#nms-configuration)
|
||||
* [INT8 calibration](#int8-calibration)
|
||||
* [Using your custom model](docs/customModels.md)
|
||||
|
||||
@@ -101,67 +102,7 @@ NVIDIA DeepStream SDK 6.1 / 6.0.1 / 6.0 configuration for YOLO models
|
||||
|
||||
### Benchmarks
|
||||
|
||||
```
|
||||
nms-iou-threshold = 0.6
|
||||
pre-cluster-threshold = 0.001 (mAP eval) / 0.25 (FPS measurement)
|
||||
batch-size = 1
|
||||
valid = val2017 (COCO) - 1000 random images for INT8 calibration
|
||||
sample = 1920x1080 video
|
||||
NOTE: Used maintain-aspect-ratio=1 in config_infer file for YOLOv4 (with letter_box=1), YOLOv5 and YOLOR models.
|
||||
```
|
||||
|
||||
#### NVIDIA GTX 1050 4GB (Mobile)
|
||||
|
||||
##### YOLOR-CSP performance comparison
|
||||
|
||||
| | DeepStream | PyTorch |
|
||||
|:---------------------:|:----------:|:-------:|
|
||||
| FPS (without display) | 13.32 | 10.07 |
|
||||
| FPS (with display) | 12.63 | 9.41 |
|
||||
|
||||
##### YOLOv5n performance comparison
|
||||
|
||||
| | DeepStream | TensorRTx | Ultralytics |
|
||||
|:---------------------:|:----------:|:---------:|:-----------:|
|
||||
| FPS (without display) | 110.25 | 87.42 | 97.19 |
|
||||
| FPS (with display) | 105.62 | 73.07 | 50.37 |
|
||||
|
||||
<details><summary>More</summary>
|
||||
<br>
|
||||
|
||||
| DeepStream | Precision | Resolution | IoU=0.5:0.95 | IoU=0.5 | IoU=0.75 | FPS<br />(without display) |
|
||||
|:------------------:|:---------:|:----------:|:------------:|:-------:|:--------:|:--------------------------:|
|
||||
| YOLOR-P6 | FP32 | 1280 | 0.478 | 0.663 | 0.519 | 5.53 |
|
||||
| YOLOR-CSP-X* | FP32 | 640 | 0.473 | 0.664 | 0.513 | 7.59 |
|
||||
| YOLOR-CSP-X | FP32 | 640 | 0.470 | 0.661 | 0.507 | 7.52 |
|
||||
| YOLOR-CSP* | FP32 | 640 | 0.459 | 0.652 | 0.496 | 13.28 |
|
||||
| YOLOR-CSP | FP32 | 640 | 0.449 | 0.639 | 0.483 | 13.32 |
|
||||
| YOLOv5x6 6.0 | FP32 | 1280 | 0.504 | 0.681 | 0.547 | 2.22 |
|
||||
| YOLOv5l6 6.0 | FP32 | 1280 | 0.492 | 0.670 | 0.535 | 4.05 |
|
||||
| YOLOv5m6 6.0 | FP32 | 1280 | 0.463 | 0.642 | 0.504 | 7.54 |
|
||||
| YOLOv5s6 6.0 | FP32 | 1280 | 0.394 | 0.572 | 0.424 | 18.64 |
|
||||
| YOLOv5n6 6.0 | FP32 | 1280 | 0.294 | 0.452 | 0.314 | 26.94 |
|
||||
| YOLOv5x 6.0 | FP32 | 640 | 0.469 | 0.654 | 0.509 | 8.24 |
|
||||
| YOLOv5l 6.0 | FP32 | 640 | 0.450 | 0.634 | 0.487 | 14.96 |
|
||||
| YOLOv5m 6.0 | FP32 | 640 | 0.415 | 0.601 | 0.448 | 28.30 |
|
||||
| YOLOv5s 6.0 | FP32 | 640 | 0.334 | 0.516 | 0.355 | 63.55 |
|
||||
| YOLOv5n 6.0 | FP32 | 640 | 0.250 | 0.417 | 0.260 | 110.25 |
|
||||
| YOLOv4-P6 | FP32 | 1280 | 0.499 | 0.685 | 0.542 | 2.57 |
|
||||
| YOLOv4-P5 | FP32 | 896 | 0.472 | 0.659 | 0.513 | 5.48 |
|
||||
| YOLOv4-CSP-X-SWISH | FP32 | 640 | 0.473 | 0.664 | 0.513 | 7.51 |
|
||||
| YOLOv4-CSP-SWISH | FP32 | 640 | 0.459 | 0.652 | 0.496 | 13.13 |
|
||||
| YOLOv4x-MISH | FP32 | 640 | 0.459 | 0.650 | 0.495 | 7.53 |
|
||||
| YOLOv4-CSP | FP32 | 640 | 0.440 | 0.632 | 0.474 | 13.19 |
|
||||
| YOLOv4 | FP32 | 608 | 0.498 | 0.740 | 0.549 | 12.18 |
|
||||
| YOLOv4-Tiny | FP32 | 416 | 0.215 | 0.403 | 0.206 | 201.20 |
|
||||
| YOLOv3-SPP | FP32 | 608 | 0.411 | 0.686 | 0.433 | 12.22 |
|
||||
| YOLOv3-Tiny-PRN | FP32 | 416 | 0.167 | 0.382 | 0.125 | 277.14 |
|
||||
| YOLOv3 | FP32 | 608 | 0.377 | 0.672 | 0.385 | 12.51 |
|
||||
| YOLOv3-Tiny | FP32 | 416 | 0.095 | 0.203 | 0.079 | 218.42 |
|
||||
| YOLOv2 | FP32 | 608 | 0.286 | 0.541 | 0.273 | 25.28 |
|
||||
| YOLOv2-Tiny | FP32 | 416 | 0.102 | 0.258 | 0.061 | 231.36 |
|
||||
|
||||
</details>
|
||||
New tests comming soon.
|
||||
|
||||
##
|
||||
|
||||
@@ -221,9 +162,11 @@ wget https://us.download.nvidia.com/tesla/510.47.03/NVIDIA-Linux-x86_64-510.47.0
|
||||
* Run
|
||||
|
||||
```
|
||||
sudo sh NVIDIA-Linux-x86_64-510.47.03.run --silent --disable-nouveau
|
||||
sudo sh NVIDIA-Linux-x86_64-510.47.03.run --silent --disable-nouveau --dkms --install-libglvnd
|
||||
```
|
||||
|
||||
**NOTE**: This step will disable the nouveau drivers.
|
||||
|
||||
* Reboot
|
||||
|
||||
```
|
||||
@@ -233,7 +176,7 @@ sudo reboot
|
||||
* Install
|
||||
|
||||
```
|
||||
sudo sh NVIDIA-Linux-x86_64-510.47.03.run --silent --dkms --install-libglvnd
|
||||
sudo sh NVIDIA-Linux-x86_64-510.47.03.run --silent --disable-nouveau --dkms --install-libglvnd
|
||||
```
|
||||
|
||||
**NOTE**: If you are using a laptop with NVIDIA Optimius, run
|
||||
@@ -326,7 +269,7 @@ sudo apt install libssl1.0.0 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-p
|
||||
sudo apt-get install linux-headers-$(uname -r)
|
||||
```
|
||||
|
||||
**NOTE**: Install DKMS only if you are using the default Ubuntu kernel
|
||||
**NOTE**: Install DKMS only if you are using the default Ubuntu kernel.
|
||||
|
||||
```
|
||||
sudo apt-get install dkms
|
||||
@@ -369,9 +312,11 @@ wget https://us.download.nvidia.com/tesla/470.129.06/NVIDIA-Linux-x86_64-470.129
|
||||
* Run
|
||||
|
||||
```
|
||||
sudo sh NVIDIA-Linux-x86_64-470.129.06.run --silent --disable-nouveau
|
||||
sudo sh NVIDIA-Linux-x86_64-470.129.06.run --silent --disable-nouveau --dkms --install-libglvnd
|
||||
```
|
||||
|
||||
**NOTE**: This step will disable the nouveau drivers.
|
||||
|
||||
* Reboot
|
||||
|
||||
```
|
||||
@@ -381,7 +326,7 @@ sudo reboot
|
||||
* Install
|
||||
|
||||
```
|
||||
sudo sh NVIDIA-Linux-x86_64-470.129.06.run --silent --dkms --install-libglvnd
|
||||
sudo sh NVIDIA-Linux-x86_64-470.129.06.run --silent --disable-nouveau --dkms --install-libglvnd
|
||||
```
|
||||
|
||||
**NOTE**: If you are using a laptop with NVIDIA Optimius, run
|
||||
@@ -519,11 +464,6 @@ network-mode=0
|
||||
# Number of classes in label file
|
||||
num-detected-classes=80
|
||||
...
|
||||
[class-attrs-all]
|
||||
# IOU threshold
|
||||
nms-iou-threshold=0.45
|
||||
# Score threshold
|
||||
pre-cluster-threshold=0.25
|
||||
```
|
||||
|
||||
#### 5. Run
|
||||
@@ -542,6 +482,7 @@ gpu-id=0
|
||||
gie-unique-id=1
|
||||
nvbuf-memory-type=0
|
||||
config-file=config_infer_primary_yoloV2.txt
|
||||
...
|
||||
```
|
||||
|
||||
##
|
||||
@@ -618,11 +559,6 @@ network-mode=0
|
||||
# Number of classes in label file
|
||||
num-detected-classes=80
|
||||
...
|
||||
[class-attrs-all]
|
||||
# IOU threshold
|
||||
nms-iou-threshold=0.45
|
||||
# Score threshold
|
||||
pre-cluster-threshold=0.25
|
||||
```
|
||||
|
||||
#### 8. Change the deepstream_app_config.txt file
|
||||
@@ -749,11 +685,6 @@ network-mode=0
|
||||
# Number of classes in label file
|
||||
num-detected-classes=80
|
||||
...
|
||||
[class-attrs-all]
|
||||
# IOU threshold
|
||||
nms-iou-threshold=0.5
|
||||
# Score threshold
|
||||
pre-cluster-threshold=0.25
|
||||
```
|
||||
|
||||
#### 8. Change the deepstream_app_config.txt file
|
||||
@@ -776,6 +707,23 @@ deepstream-app -c deepstream_app_config.txt
|
||||
|
||||
##
|
||||
|
||||
### NMS Configuration
|
||||
|
||||
To change the `iou-threshold`, `score-threshold` and `topk` values, modify the `config_nms.txt` file and regenerate the model engine file.
|
||||
|
||||
**NOTE**: Lower `topk` values will result in more performance.
|
||||
|
||||
**NOTE**: Make sure to set cluster-mode=4 and pre-cluster-threshold=0 in config_infer file.
|
||||
|
||||
```
|
||||
[property]
|
||||
iou-threshold=0.45
|
||||
score-threshold=0.25
|
||||
topk=300
|
||||
```
|
||||
|
||||
##
|
||||
|
||||
### INT8 calibration
|
||||
|
||||
#### 1. Install OpenCV
|
||||
|
||||
Reference in New Issue
Block a user