marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.38k stars 344 forks source link

YOLOV5 model has very weak detection capability after deployment #251

Open chengzihencai opened 1 year ago

chengzihencai commented 1 year ago

Jetpack 4.6 deepstream 6.0.1 yolov5 6.1 I tested yolov5s , yolov7 , yolor (untrained,all of them),the can work well. I trained yolov5(changed backbone,but layers(CBH , LC_block , Dense) can be find in gen_wts_yoloV5.py), the model in pytorch can work ,tested by detect.py. I found that my improved YOLOV5 model had very weak detection ability after transformation, and used the default precision (FP32) when generating the model.

chengzihencai commented 1 year ago

Update some information:I try to use the five hyp files of yolov5 for training and get five models. I found that their results under deepstream are different, but they are very poor.

After I modified cfg.yaml file, I expanded the parameters of each layer to twice the previous one, and after retraining I got a model that was more than twice as large as the previous model, although its detection speed became slower, this test did not find a misdetected target, there was a certain correct target, but there was a certain missed detection.

marcoslucianops commented 1 year ago

Jetpack 4.6 deepstream 6.0.1 yolov5 6.1 I tested yolov5s , yolov7 , yolor (untrained,all of them),the can work well. I trained yolov5(changed backbone,but layers(CBH , LC_block , Dense) can be find in gen_wts_yoloV5.py), the model in pytorch can work ,tested by detect.py. I found that my improved YOLOV5 model had very weak detection ability after transformation, and used the default precision (FP32) when generating the model.

About layers, there is probably another different implementation you did that I didn't identify during the additions of those new layers. I need more info on what you changed in yolov5 to fix it.

Update some information:I try to use the five hyp files of yolov5 for training and get five models. I found that their results under deepstream are different, but they are very poor.

After I modified cfg.yaml file, I expanded the parameters of each layer to twice the previous one, and after retraining I got a model that was more than twice as large as the previous model, although its detection speed became slower, this test did not find a misdetected target, there was a certain correct target, but there was a certain missed detection.

There's an accuracy drop on TensorRT models converted from PyTorch. I'm trying to find a solution for it.

chengzihencai commented 1 year ago

Jetpack 4.6 deepstream 6.0.1 yolov5 6.1 I tested yolov5s , yolov7 , yolor (untrained,all of them),the can work well. I trained yolov5(changed backbone,but layers(CBH , LC_block , Dense) can be find in gen_wts_yoloV5.py), the model in pytorch can work ,tested by detect.py. I found that my improved YOLOV5 model had very weak detection ability after transformation, and used the default precision (FP32) when generating the model.

About layers, there is probably another different implementation you did that I didn't identify during the additions of those new layers. I need more info on what you changed in yolov5 to fix it.

Update some information:I try to use the five hyp files of yolov5 for training and get five models. I found that their results under deepstream are different, but they are very poor. After I modified cfg.yaml file, I expanded the parameters of each layer to twice the previous one, and after retraining I got a model that was more than twice as large as the previous model, although its detection speed became slower, this test did not find a misdetected target, there was a certain correct target, but there was a certain missed detection.

There's an accuracy drop on TensorRT models converted from PyTorch. I'm trying to find a solution for it.

I will send my file via email,they are all the files I have changed.

ledinhtri97 commented 1 year ago

@marcoslucianops do you have any update on this accuracy issue.

I also tried the repo build TensoRT yolov7 engien from wang-xinyu/tensorrtx and see their model engine has more object detection than your engine created. Of course the condition is fair to compare

marcoslucianops commented 1 year ago

I will do some tests to verify it.

lswgh commented 1 year ago

I had the same problem above! did you have any way about this ?

marcoslucianops commented 1 year ago

No updates yet.

KindOfBlue7 commented 1 year ago

Any updates regarding lower accuracy after deployment? I have the same issue with missing detections using Yolov5n trained on custom data.

marcoslucianops commented 1 year ago

Any updates regarding lower accuracy after deployment? I have the same issue with missing detections using Yolov5n trained on custom data.

https://github.com/marcoslucianops/DeepStream-Yolo/issues/339