Different results from detect vs val, "no detections" #12861
Unanswered
PeterKBailey
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I hope I'm asking this in the right place but I'm new to YOLO and have been trying to determine if I have properly built and structured my dataset.
I used the following command to first train the model on a very small data subset (222 images)
python yolov5/train.py --img 640 --batch 16 --epochs 3 --data dataset.yaml --weights '' --cfg yolov5n.yamlI also included a validation directory which contains the exact same images in my training set. All I'm trying to do right now is see that I can make a model which overfits / perfectly predicts for this training data.
After having completed the training I did two things:
python detect.py --weights best.pt --img 640 --data dataset.yaml --source image.jpg --conf-thres 0.01and
python .val.py --weights best.pt --img 640 --data dataset.yamlwith the following results: (output from detect on left, and output from val on the right)
Please excuse the resolution, this is a cropped in screenshot but is only meant to show that the validation batch worked as expected but that detection on the image apparently did not.
Things I have tried:
I'm not sure where to go from here so advice would be greatly appreciated! Thanks!
OS: Windows 10
YOLOv5 v7.0-295-gac6c4383 Python-3.11.6 torch-2.2.1+cpu CPU
Edit with additional things I have tried:
I have also double checked my bounding boxes with the YoloBBoxChecker and am certain that my text files are correct. I didn't doubt this particularly given that val is successful but figured it was one more item on the list.

Beta Was this translation helpful? Give feedback.
All reactions