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

Missing: calculation of bounding box center relative to grid cell in preprocess_true_boxes #58

Open
mrtpk opened this issue Mar 15, 2020 · 0 comments

Comments

@mrtpk
Copy link

mrtpk commented Mar 15, 2020

The x and y coordinates in true_boxes are expressed relative to image dimensions in L256-
true_boxes[..., 0:2] = boxes_xy/input_shape[::-1]

Then these values are used in L297-
y_true[l][b, j, i, k, 0:4] = true_boxes[b,t, 0:4]

  • Shouldn't the center coordinates - x and y of the bounding box expressed relative to the starting point of the grid, (cx, cy) ?
i = np.floor(true_boxes[b,t,0]*grid_shapes[l][1]).astype('int32')
j = np.floor(true_boxes[b,t,1]*grid_shapes[l][0]).astype('int32')
y_true[l][b, j, i, k, 0] = true_boxes[b,t,0]*grid_shapes[l][1] - i
y_true[l][b, j, i, k, 1] = true_boxes[b,t,1]*grid_shapes[l][0] - j

Are you doing this later in the code? Your insights on these doubts are highly appreciated.
Thanks for your time,
Thomas.

y_true[l][b, j, i, k, 0:4] = true_boxes[b,t, 0:4]

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