WongKinYiu / yolor

implementation of paper - You Only Learn One Representation: Unified Network for Multiple Tasks (https://arxiv.org/abs/2105.04206)
GNU General Public License v3.0
1.99k stars 517 forks source link

Bounding box size is off #279

Closed stalagmite7 closed 2 years ago

stalagmite7 commented 2 years ago

I am trying to train a yolor-p6 model on my own custom dataset (paper branch). Using default data preprocessing of "mosaic" (not feeding in the --rect flag while starting the training script)

The box in the left image is the ground truth, the box in the right image is the prediction (for the same class)

image

Not sure why this is happening since I didn't modify anything in the code; plus it worked well when I tested the yolor-p6 model out of the box on the included horses image (boxes were correct/tightly fitted around the horses)

stalagmite7 commented 2 years ago

It seems to be this code block thats causing the change, I verified by plotting the bounding boxes before and after this block (similar as example image above, in training - not prediction) What is the reason for this change in the dimensions of the box when training?

stalagmite7 commented 2 years ago

My mistake - the data I was feeding in was in normalized xyxy format, whereas it expected it in normalized xywh format. Changed whatever was necessary and works with my data now.