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

About loading the labels #44

Closed
strive1127 opened this issue Jun 19, 2018 · 0 comments
Closed

About loading the labels #44

strive1127 opened this issue Jun 19, 2018 · 0 comments

Comments

@strive1127
Copy link

Why you do this one in the datasets.py?
x1 = w * (labels[:, 1] - labels[:, 3]/2)
y1 = h * (labels[:, 2] - labels[:, 4]/2)
x2 = w * (labels[:, 1] + labels[:, 3]/2)
y2 = h * (labels[:, 2] + labels[:, 4]/2)
# Adjust for added padding
x1 += pad[1][0]
y1 += pad[0][0]
x2 += pad[1][0]
y2 += pad[0][0]
# Calculate ratios from coordinates
#print labels,float(h) / float(padded_h), h, padded_h, w, padded_w
'''
labels[:, 1] = ((x1 + x2) / 2) / padded_w
labels[:, 2] = ((y1 + y2) / 2) / padded_h
labels[:, 3] *= w / padded_w
labels[:, 4] *= h / padded_h
'''

        labels[:, 3] *= float(w) / float(padded_w)
        labels[:, 4] *= float(h) / float(padded_h)
        labels[:, 1] = ((x1 + x2) / 2) / float(padded_w)
        labels[:, 2] = ((y1 + y2) / 2) / float(padded_h)
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

1 participant