AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.75k stars 7.96k forks source link

darknet to tensrrt model #4665

Open ou525 opened 4 years ago

ou525 commented 4 years ago

I trained a yolov3-spp model based on darkent, and at the same time I converted it to a tensorrt model, but I found that it has more false detections than tests based on darknet. precision:float32, no int8

AlexeyAB commented 4 years ago

@ou525

isra60 commented 4 years ago

How do you convert a darknet model to TensorRT??

ou525 commented 4 years ago

@AlexeyAB @isra60 i use the nvidia demo, https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/tree/restructure/yolo/apps/trt-yolo

i add the flag -letter_box, but I don't find any difference

AlexeyAB commented 4 years ago

but I found that it has more false detections than tests based on darknet.

Can you show screenshot of detections?

ou525 commented 4 years ago

darknet_box trt_box @AlexeyAB these two pictures are the most obvious place for this scene.

AlexeyAB commented 4 years ago
ou525 commented 4 years ago

@AlexeyAB sorry, I retested the add and without flag -letter_box, it does appear similar to the false detection under trt, but it does not always appear on the same picture. At the same time, I checked the content of letter_box. Is it caused by the different input of trt's blobFromImage () and darknet's letterbox_image ()?

i only use the yoov3-spp.cfg, trained without -letter_box.

I extracted the feature values of layer81 of the yolov3-spp network, which seems to be very different from those under trt. darknet.txt trt.txt

AlexeyAB commented 4 years ago

@AlexeyAB sorry, I retested the add and without flag -letter_box, it does appear similar to the false detection under trt, but it does not always appear on the same picture.

Do you mean that each run of the same command with the same image gives a different result? ./darknet detector test ... test.jpg -letter_box

ou525 commented 4 years ago

The test results are unique. The first results may be obtained by other model tests.

I replaced trt's letter_box with direct resize, and now the result seems to be normal.

AlexeyAB commented 4 years ago

You should

ou525 commented 4 years ago

Thanks for your suggestions, I will try to do it.

ttdd11 commented 4 years ago

@ou525 How did you convert trained .weights and .cfg to tensorRT? Been struggling with this for a while, why guidance would be greatly appreciated.