facebookresearch / ov-seg

This is the official PyTorch implementation of the paper Open-Vocabulary Semantic Segmentation with Mask-adapted CLIP.
Other
676 stars 61 forks source link

Update adapter.py #23

Open lartpang opened 11 months ago

lartpang commented 11 months ago

Solve the problem of mismatch in the number of return values in special cases.

lartpang commented 11 months ago

@Jeff-LiangF

Jeff-LiangF commented 11 months ago

@lartpang ,Thanks for creating this merge request. Could you point out when the bug would be trigged so that I can test the bug in my end?

lartpang commented 11 months ago

@Jeff-LiangF

This is what happens when I run the code on my own dataset.

In the original code, the code will go into this if statement when using my dataset:

https://github.com/facebookresearch/ov-seg/blob/36f49d496714998058d115ffb6172d9d84c59065/open_vocab_seg/modeling/clip_adapter/adapter.py#L179-L180

Then, go to the following code and the return value of self._preprocess_image here is wrong:

https://github.com/facebookresearch/ov-seg/blob/36f49d496714998058d115ffb6172d9d84c59065/open_vocab_seg/modeling/clip_adapter/adapter.py#L126-L128

Finally, the return value is also wrong in these code:

https://github.com/facebookresearch/ov-seg/blob/36f49d496714998058d115ffb6172d9d84c59065/open_vocab_seg/ovseg_model.py#L236-L239

So I changed the form of these return values.

lartpang commented 9 months ago

@Jeff-LiangF

Looking forward to your response.

vmmm123 commented 8 months ago

Thanks!met the same problem