TensorFlow-2.x-YOLOv3 icon indicating copy to clipboard operation
TensorFlow-2.x-YOLOv3 copied to clipboard

image_preprocess resizing

Open lukqw opened this issue 4 years ago • 4 comments

hi, I just stumbled upon the code of image_preprocess in yolov3/utils.py why is the image padded instead of resized (stretched) correctly? is this why the boxes work better in my example with cv2 vs tf?

image

lukqw avatar Jul 08 '21 22:07 lukqw

on a sidenote: I removed the second cv2.cvtColor from my code as well as mentioned in this issue (https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3/issues/131) that's why the resized cv2 image is correctly colored

lukqw avatar Jul 08 '21 23:07 lukqw

I have made the following changes to the utils functions: image_preprocess image

postprocess_boxes image

I do realize a PR would be easier to follow but I am kinda lazy right now and would rather discuss if this is the right approach or not.

Results: image

image

lukqw avatar Jul 08 '21 23:07 lukqw

Hi, you did interesting testing. I'll try this by myself and measure mAP before and after this change. I Will let you know the results.

pythonlessons avatar Jul 09 '21 08:07 pythonlessons

looking forward to your results!

lukqw avatar Jul 14 '21 15:07 lukqw