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

Decoding object context #107

Open
ruinianxu opened this issue Oct 24, 2021 · 3 comments
Open

Decoding object context #107

ruinianxu opened this issue Oct 24, 2021 · 3 comments

Comments

@ruinianxu
Copy link

Hi all,

I am confused about the code doing object context decoding. I attached the related code of decoder_rnn.py:

labels_to_embed = labels[start_ind:end_ind].clone()
# Whenever labels are 0 set input to be our max prediction
nonzero_pred = pred_dist[:, 1:].max(1)[1] + 1
is_bg = (labels_to_embed.data == 0).nonzero()
if is_bg.dim() > 0:
    labels_to_embed[is_bg.squeeze(1)] = nonzero_pred[is_bg.squeeze(1)]
out_commitments.append(labels_to_embed)
previous_embed = self.obj_embed(labels_to_embed+1)

First of all, based on the paper, LSTM will take the previous object class prediction as input. But based on this code, if there is no bg (which is background), nonzero_pred won't be used to update labels_to_embed which is used to extract embeddings from self.obj_embed. Meanwhile in most of cases, there is no bg category. This code seems take the object category probability distribution predicted by faster-rcnn as input.

Please let me know if I understand it correctly.

@dongxinfeng1
Copy link

Hi, I've been working on this code lately.  Can you run this code without bugs? I followed the author's requirements for environment and dataset except the Torch version is 0.3.1, but encountered some problems.
 

@ruinianxu
Copy link
Author

Yes, I do. I will recommend you to use PyTorch under 0.4 since one of his implementations is based on that and it was officially dumped after PyTorch 0.4.

@dongxinfeng1
Copy link

Thanks for your response, I'll try it later.

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