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

Why subtract 1 in flip? #32

Open
moekaungkin11 opened this issue Dec 4, 2019 · 1 comment
Open

Why subtract 1 in flip? #32

moekaungkin11 opened this issue Dec 4, 2019 · 1 comment

Comments

@moekaungkin11
Copy link

Why 1 is subtract in adjusting the boxes coordinates after horizontal flipping?What is 1 mean? I thought this already satisfied without subtracting 1.Am i wrong?
The code is....
new_boxes[:, 0] = image.width - boxes[:, 0] - 1
new_boxes[:, 2] = image.width - boxes[:, 2] - 1

@slmatrix
Copy link

slmatrix commented Aug 5, 2020

image.width is not a zero indexed value; that is why subtraction by one is done. It ensures the horizontal flip is within the bounds of the image tensor.

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