qqwweee / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend)
MIT License
7.14k stars 3.44k forks source link

It is normal that right or bottom of a bounding box become a negative number in early epoch? #687

Open tenten1010 opened 4 years ago

tenten1010 commented 4 years ago

I was about to calculate the average IOU of each epoch, and I found out some strange value. So I just check the results of bounding boxes and I found out some of them are having a negative right or bottom value, which does not make sense at all.

Then I check the code, and the code was like

top = max(0, np.floor(top + 0.5).astype('int32'))
left = max(0, np.floor(left + 0.5).astype('int32'))
bottom = min(image.size[1], np.floor(bottom + 0.5).astype('int32'))
right = min(image.size[0], np.floor(right + 0.5).astype('int32'))

in yolo.py

It looks like there's no limitation to keep the bottom or right in positive, which is weird. Could somebody explain it to me??