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

How to take the prediction mask of each target in the previous frame? #64

Closed
longmalongma opened this issue Sep 27, 2021 · 9 comments
Closed

Comments

@longmalongma
Copy link

@hkchengrex Because two targets are fixed during training, prev_mask[:,0:1] and prev_mask[:,1:2] can be used to take the masks of the two targets in the previous frame. However, the number of targets during testing is not fixed. How to take the prediction mask of each target in the previous frame?

for i, oi in enumerate(self.enabled_obj):
self.prob[self.enabled_obj,ti-1].cuda()

image

image

@hkchengrex
Copy link
Owner

You're right.
self.enabled_obj is a list containing object indices that we have seen.

@longmalongma
Copy link
Author

longmalongma commented Sep 28, 2021

You're right.
self.enabled_obj is a list containing object indices that we have seen.
@hkchengrex Self. enabled_obj also contains background information?How to extract only a few target prediction masks in self.enabled_obj, because the training code only uses value encoder for each target mask

@hkchengrex
Copy link
Owner

No. I don't understand what exactly you mean but you can always use indexing to extract whatever you need.
Here is a tutorial: https://numpy.org/doc/stable/reference/arrays.indexing.html

@longmalongma
Copy link
Author

No. I don't understand what exactly you mean but you can always use indexing to extract whatever you need.
Here is a tutorial: https://numpy.org/doc/stable/reference/arrays.indexing.html

@hkchengrex Is that how I take the predictive mask of all the targets?
for i, oi in enumerate(self.enabled_obj):
self.prob[self.enabled_obj,ti-1].cuda()
Does self.prob[0,ti-1].cuda() represent background for previous frame?
Does self.prob[1,ti-1].cuda() represent the predictive mask of the first target for previous frame?
Does self.prob[2,ti-1].cuda() represent the predictive mask of the second target for previous frame?

@hkchengrex
Copy link
Owner

Yes.
That seems to be already explained in another issue that you opened: #60

@longmalongma
Copy link
Author

Yes.
That seems to be already explained in another issue that you opened: #60

Ok, thank you very much!

@longmalongma
Copy link
Author

Yes.
That seems to be already explained in another issue that you opened: #60

Ok, thank you very much!

@hkchengrex
for i, oi in enumerate(self.enabled_obj):
self.prob[oi, ti-1].cuda().unsqueeze(0))
print(self.prob[oi, ti-1].cuda().size())

             torch.Size([1, 480, 864])
            print(self.prob[self.enabled_obj, ti-1].cuda().size())
             torch.Size([3,1, 480, 864])

So I want to code mask, I have to, right?
self.prob[oi, ti-1].cuda().unsqueeze(0))
or self.prob[oi, ti-1].cuda().unsqueeze(1))

1 similar comment
@longmalongma
Copy link
Author

Yes.
That seems to be already explained in another issue that you opened: #60

Ok, thank you very much!

@hkchengrex
for i, oi in enumerate(self.enabled_obj):
self.prob[oi, ti-1].cuda().unsqueeze(0))
print(self.prob[oi, ti-1].cuda().size())

             torch.Size([1, 480, 864])
            print(self.prob[self.enabled_obj, ti-1].cuda().size())
             torch.Size([3,1, 480, 864])

So I want to code mask, I have to, right?
self.prob[oi, ti-1].cuda().unsqueeze(0))
or self.prob[oi, ti-1].cuda().unsqueeze(1))

@hkchengrex
Copy link
Owner

Whether to use unsqueeze depends on your needs.

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