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

Code to build the spatial adjacency matrix #9

Closed
yashkant opened this issue Feb 6, 2020 · 3 comments
Closed

Code to build the spatial adjacency matrix #9

yashkant opened this issue Feb 6, 2020 · 3 comments

Comments

@yashkant
Copy link

yashkant commented Feb 6, 2020

Hi,

Thanks for sharing the code. Could you also share the code for building the adjacency matrix of spatial relations from bounding boxes?

Thanks.

@linjieli222
Copy link
Owner

Thank you for your interests in this project. You can call this function to build spatial graph:

def build_graph(bbox, spatial, label_num=11):

@yashkant
Copy link
Author

yashkant commented Feb 6, 2020

Thanks for the instant reply @linjieli222, could you help me with these follow-up questions:

  1. What is the spatial argument which is used below? Also, is bbox[0] the image bounding-box?

    image_h = bbox_height[0]/spatial[0, -1]

  2. Are the bbox coordinates normalized or are they absolute values?

@linjieli222
Copy link
Owner

linjieli222 commented Feb 7, 2020

Sorry about the confusion.

  1. spatial here is just normalized bb. It is only used to get image_h and image_w. If you happen to have image_h and image_w in hand, no need to generate normalized bb
  2. bbox is not normalized, just pass it as it is from detection model.

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