Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YOLOv4 image resizing #7349

Open
ghost opened this issue Feb 7, 2021 · 6 comments
Open

YOLOv4 image resizing #7349

ghost opened this issue Feb 7, 2021 · 6 comments

Comments

@ghost
Copy link

ghost commented Feb 7, 2021

I am trying to understand the concept of resizing input images to fit network size. I have been through several issues in this Github repository and I haven't seen a clear explanation.

I, let's say, have an image of 1920 x 2000 and the network size is 416 x 416, does that mean the input image will be "compressed/squeezed" into a smaller shape. Wouldn't that mean that small objects might be squeezed into almost 1 pixel ?

If I can have the link to the code sample where the squeezing is performed to further understand this concept, that would be appreciated.

Thank you !

@stephanecharette
Copy link
Collaborator

See: https://www.ccoderun.ca/programming/darknet_faq/#square_network and https://www.ccoderun.ca/programming/darknet_faq/#time_to_train

If your objects become "almost 1 pixel" when you resize to your network dimensions, then Darknet/YOLO wont find them.

@ghost
Copy link
Author

ghost commented Feb 7, 2021

See: https://www.ccoderun.ca/programming/darknet_faq/#square_network and https://www.ccoderun.ca/programming/darknet_faq/#time_to_train

If your objects become "almost 1 pixel" when you resize to your network dimensions, then Darknet/YOLO wont find them.

Thank you ! This is answers a lot of questions I had 👍🏼

@rabsym
Copy link

rabsym commented Feb 8, 2021

See: https://www.ccoderun.ca/programming/darknet_faq/#square_network and

Before reading this I thought yolo keeps aspect ratio, ie. image 1280x720 will be resized to 416x234, and then inserted into 416x416 network.
Maybe I was wrong :?

@stephanecharette
Copy link
Collaborator

You are wrong. As described in the link, it does not maintain aspect ratio.

@TobiasVorsmann
Copy link

If you set letter_box = 1 in [net] section it keeps the aspect ratio (section For training only -> Data augmentation -> letter_box: https://github.com/AlexeyAB/darknet/wiki/CFG-Parameters-in-the-%5Bnet%5D-section)

@lsd1994
Copy link

lsd1994 commented Feb 10, 2021

Here is the difference between resize and letter_box.
#232 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants