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 the bbox #5

Open
BAZINGAC opened this issue Mar 15, 2021 · 0 comments
Open

About the bbox #5

BAZINGAC opened this issue Mar 15, 2021 · 0 comments

Comments

@BAZINGAC
Copy link

Hello,Is the box in the h5 file x,y,w,h, and x1,y1,x2,y2(spatial_feat[0, :] ,spatial_feat[1, :] ,spatial_feat[2, :] ,spatial_feat[3, :] ) are the points in the upper left and lower right corners?
with h5py.File(self.feature_h5, 'r') as f:
vision_feat = f['features'][index]
boxes = f['boxes'][index]
w = f['widths'][index]
h = f['heights'][index]
spatial_feat = np.zeros((5, len(boxes[0])))
spatial_feat[0, :] = boxes[0, :] * 2 / w - 1 # x1
spatial_feat[1, :] = boxes[1, :] * 2 / h - 1 # y1
spatial_feat[2, :] = boxes[2, :] * 2 / w - 1 # x2
spatial_feat[3, :] = boxes[3, :] * 2 / h - 1 # y2

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