Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Update adapter.py#23

Open
lartpang wants to merge 1 commit intofacebookresearch:mainfrom
lartpang:patch-1
Open

Update adapter.py#23
lartpang wants to merge 1 commit intofacebookresearch:mainfrom
lartpang:patch-1

Conversation

@lartpang
Copy link
Copy Markdown

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

Solve the problem of mismatch in the number of return values in special cases.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 17, 2023
@lartpang
Copy link
Copy Markdown
Author

@Jeff-LiangF

@Jeff-LiangF
Copy link
Copy Markdown
Contributor

@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
Copy link
Copy Markdown
Author

lartpang commented Oct 18, 2023

@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:

if len(regions) == 0:
return None, valid

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

(regions, unnorm_regions), region_masks, valid_flag = self._preprocess_image(image, mask, normalize=normalize)
if regions is None:
return None, valid_flag

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

if self.clip_ensemble:
clip_cls, regions, valid_flag = self.clip_adapter(
image, class_names, mask_pred, normalize=True
)

So I changed the form of these return values.

@lartpang
Copy link
Copy Markdown
Author

@Jeff-LiangF

Looking forward to your response.

@vmmm123
Copy link
Copy Markdown

vmmm123 commented Dec 29, 2023

Thanks!met the same problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants