Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

scene graphs #12

Open
SunshineJunFu opened this issue May 20, 2019 · 4 comments
Open

scene graphs #12

SunshineJunFu opened this issue May 20, 2019 · 4 comments

Comments

@SunshineJunFu
Copy link

Could you provide codes for generating scene graphs in JSON format?

@moon-landing
Copy link

sg2im/data/coco.py

@wang-zm18
Copy link

hi, could you please tell me how to visualize scene graphs on the validation dataset of COCO-Stuff? There are lack of prepared json files for each image.

@jcjohnson
Copy link
Collaborator

This is the function we used to make scene graph visualizations:

https://github.com/google/sg2im/blob/master/sg2im/vis.py#L110

There isn't any code that works out-of-the-box to run this on COCO-Stuff validation images; but it should be pretty straightforward to write a standalone script that builds a COCO data loader, (https://github.com/google/sg2im/blob/master/sg2im/data/coco.py), iterates through it to construct random scene graphs, then use the draw_scene_graph function to visualize them.

@wang-zm18
Copy link

Thank you, Justin! I have complete this code. But a found a small mistake in line 139 of vis.py. I think "p = vocab['pred_name_to_idx'][triples[i, 1].item()]" should be changed into "p = vocab['pred_idx_to_name'][triples[i, 1].item()]".

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants