spacewalk01 / tensorrt-yolov9

Cpp and python implementation of YOLOv9 using TensorRT API
https://github.com/WongKinYiu/yolov9
MIT License
111 stars 18 forks source link

NMS supporting #4

Closed Egorundel closed 8 months ago

Egorundel commented 8 months ago

Hello, does your code support NMS plugins? I tried with BatchedNMSDynamic_TRT and EfficientNMS_TRT, and realized that the code was not working.

Screenshot:

Screenshot from 2024-02-28 08-53-18

Error code:

yolov9_tensorrt_C++ /home/egorundel/projects/yolov9_tensorrt_C++/yolov9.trt /home/egorundel/Videos/video4.avi
[02/28/2024-08:55:25] [E] [TRT] 3: getPluginCreator could not find plugin: EfficientNMS_TRT version: 1
[02/28/2024-08:55:25] [E] [TRT] 1: [pluginV2Runner.cpp::load::303] Error Code 1: Serialization (Serialization assertion creator failed.Cannot deserialize plugin since corresponding IPluginCreator not found in Plugin Registry)
spacewalk01 commented 8 months ago

Hi, I used opencv nms function to postprocess the output. It doesn't use batched nms.

https://github.com/spacewalk01/TensorRT-YOLOv9/blob/575863b8d7a678eaa3ac2e2ed3b93892ae7c56d2/src/yolov9.cpp#L134

Egorundel commented 8 months ago

@spacewalk01 Hmm, can you tell me what I need to do if I already have an NMS module in my model?

Screenshot: Screenshot from 2024-02-28 09-09-41

spacewalk01 commented 8 months ago

If you already have nms in your model, TensorRT: you need batchedNMSPlugin plugin which only works on linux as far as I know. onnx: in case of onnx, you can just run onnxruntime inference without any plugin and filter out boxes with confidence scores greater than threshold.