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

how to configure stretching vs. letteboxing #3119

Closed
LukeAI opened this issue May 8, 2019 · 3 comments
Closed

how to configure stretching vs. letteboxing #3119

LukeAI opened this issue May 8, 2019 · 3 comments
Assignees
Labels
enhancement want enhancement Want to improve accuracy, speed or functionality

Comments

@LukeAI
Copy link

LukeAI commented May 8, 2019

I understand that by default, darknet (in this repo.) will stretch images to the network dimensions during training. Is it possible to configure it to preserve aspect ratio with letterboxing instead?

@AlexeyAB
Copy link
Owner

AlexeyAB commented Jun 28, 2019

By default this repository resizes images to the network size (width= and height= in cfg-file) without keepeing aspect ratio: #232 (comment)

To keep aspect ratio:

  • during Training: set letter_box=1 in the [net] section in cfg-file

  • during Detection and checking mAP: use flag -letter_box in the command
    ./darknet detector map cfg/coco.data cfg/yolov3-spp.cfg yolov3-spp.weights -letter_box

@lq0104
Copy link

lq0104 commented Nov 25, 2019

hi @AlexeyAB , my question is does the cmd "darknet detector calc_anchors" supports "letteboxing" option? I think if I have trained dataset with the "letteboxing" option, is it better to use anchors with the same option?

@AlexeyAB AlexeyAB added the want enhancement Want to improve accuracy, speed or functionality label Nov 25, 2019
@AlexeyAB
Copy link
Owner

@lq0104
No, it calc_anchors doesn't support letterboxing.

Yes, may be we should implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement want enhancement Want to improve accuracy, speed or functionality
Development

No branches or pull requests

4 participants