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

Probable bug in image retrieval code #64

Closed
mods333 opened this issue Jul 30, 2020 · 5 comments
Closed

Probable bug in image retrieval code #64

mods333 opened this issue Jul 30, 2020 · 5 comments

Comments

@mods333
Copy link

mods333 commented Jul 30, 2020

Hi, I was trying to use the code for the image retrieval task. The code in 'dataloader.py and 'preprocessing.py seem to be somewhat inconsistent.
In dataloader.py there is _generate_tensor_by_idx that looks for 'image_graph and 'text_graph key in the img_txt_sg variable
image

However in the preprocessing code the output dictionary created had only two keys img and txt
image

I was wondering if there is something missing in the code or if I am doing something wrong.

@KaihuaTang
Copy link
Owner

sorry, my fault. I think 'image_graph' and 'test_graph' keys have been discarded, which means the following 4 lines can be removed from dataloader.py

image

@mods333
Copy link
Author

mods333 commented Jul 30, 2020

@KaihuaTang I think those lines are required as in the scene graph encoding model (modelv2.py), the graph is used as attention weights.
image

From the code and the paper, what I understand is that the image_graph corresponds to the following equation in the paper.
image

I can add some code to compute the image_graph during preprocessing but I am not sure how the text_graph is to be generated

@KaihuaTang
Copy link
Owner

text_graph should be implemented the same as image_gaph. I didn't differentiate them in structure except for the vocabulary. sorry that I lost this part of codes. preprocessing.py was merged from several independent jupyter notes. I think I forgot to paste some functions.

@mods333
Copy link
Author

mods333 commented Jul 31, 2020

I will try to figure out the missing part. Thanks for the help. Also thanks a lot for sharing this repository. Amazing work!

@mods333 mods333 closed this as completed Aug 1, 2020
@cws7777
Copy link

cws7777 commented Nov 11, 2020

@mods333 Have you figured out the missing part? because I'm kinda lost.. Thanks! :)

KaihuaTang added a commit that referenced this issue Mar 17, 2022
Makes the image retrieval part work without too much effort. (should address issues #64 and #109)
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

3 participants