YOLO cannot detect the target after getting the weights from training

  1. By creating your own data set and running the train.py file, you can get your own weight file.

  1. Bring the weight file into the detect.py file and find that it can run, but the target in the picture and video cannot be recognized.

3. The version of opencv-python is too high. I took a look and it turns out that the version is already 4.6. I guess there is a problem with the version of opencv-python, but the result is that it still doesn’t work.

https://blog.csdn.net/adai5210/article/details/128271384?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_utm_term~default-2-128271384-blog-125722979.pc_relevant_vip_default&spm=1001.2101.3001.4242.2&utm_relevant_index=5

4. Add: cudnn.benchmark = True in detect.py - useless.

https://blog.csdn.net/hh571050143/article/details/119984840?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-119984840-blog-128271384.pc_relevant_vip_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-1-119984840-blog-128271384.pc_relevant_vip_default&utm_relevant_index=2

5. The number of training times is not enough, increase it to 300, parser.add_argument('--epochs', type=int, default=300)

https://blog.csdn.net/todo_cct/article/details/125722979?ops_request_misc=&request_id=&biz_id=102&utm_term=yolov5%E7%9A%84%E7%9B%AE%E6%A0%87%E6%97%A0%E6%B3%95%E8%AF%86%E5%88%AB&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-9-125722979.142^v73^control,201^v4^add_ask,239^v2^insert_chatgpt&spm=1018.2226.3001.4187

Result - OK

Therefore, increasing the number of training times will indeed help improve the recognition rate

Guess you like

Origin blog.csdn.net/qq_56508207/article/details/129543912