We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 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)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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
'''
The text was updated successfully, but these errors were encountered: