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

Bounding boxes: VOC to darknet transform - why minus 1? #4565

Open
umbrellait-maksim-titarenko opened this issue Dec 21, 2019 · 2 comments
Open

Comments

@umbrellait-maksim-titarenko

Hello!

Exploring the issue of converting annotations for custom model training, I discovered that we apply the following transform to the VOC (see: scripts/voc_label.py):

    x = (box[0] + box[1])/2.0 - 1
    y = (box[2] + box[3])/2.0 - 1

where:

  • bbox[:4] are "bndbox"-values: xmin, xmax, ymin, ymax - parsed from VOC xml-files,
  • x, y assumed to be a coordinate of the center of "bndbox".

I'm a bit confused with that since:
e.g. we have a box with xmin, xmax = 10, 20
in this case, intuitively, the x-center should be at the point = 15
however, the code above will give us the value 14.0

My question is:

  • Why do we apply those "minus 1"?
    Do the VOC-annotation coordinates differ from the generally accepted ones (0,0 - for the left top corner)?
@umbrellait-maksim-titarenko
Copy link
Author

I see there was the commit to apply the "minus 1" operations:

Снимок экрана 2019-12-21 в 19 21 33

@AlexeyAB, can you please comment on why was this done?

@Sarah20187
Copy link

same question here, Thanks!

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

2 participants