yolov5-opencv-cpp-python
yolov5-opencv-cpp-python copied to clipboard
Error launch yolo.py or yolo-tiny.py
Hello,
When i test your program, with opencv 4.5.5, i have this error. Do you have an idear, what is the problem ?
Command :
Traceback (most recent call last):
File "python/yolo-tiny.py", line 40, in
Thanks for your answer. Have a nice day.
yes you can't compare confidence to the number 0.4 because confidence is an array of values. So this can't ever have worked.
I just changed the if to True to see what breaks next, and just fails on line 60. So what's happened is that there is a breaking change in OpenCV? Everything else is included in the repository so that shouldn't have broke itself.
Anyway - no good now.
Download .pt model. https://github.com/ultralytics/YOLOv5/releases/download/v6.1/YOLOv5s.pt
And export to ONNX again git clone https://github.com/ultralytics/YOLOv5 cd YOLOv5 pip install -r requirements.txt pip install onnx python3 export.py --weights models/YOLOv5s.pt --include onnx
Use the new converted .onnx file can solve the problem!
Make sure your openCV version is 4.5.4.60
pip install opencv-python==4.5.4.60