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

Automatic-Mask-Generation use finetuning model on SAM. #443

Open
unmo opened this issue Jun 25, 2024 · 1 comment
Open

Automatic-Mask-Generation use finetuning model on SAM. #443

unmo opened this issue Jun 25, 2024 · 1 comment

Comments

@unmo
Copy link

unmo commented Jun 25, 2024

I followed this notebook for finetuning the SAM on custom data, and save finetuning model to "./model_path".

The following code was executed using the resulting model.

from transformers import pipeline
generator = pipeline("mask-generation", model="./model_path", device=0, output_bboxes_mask=True)
outputs = generator(img, points_per_batch=1)

However, I got the same result as the following code.

from transformers import pipeline
generator = pipeline("mask-generation", model="facebook/sam-vit-large", device=0, output_bboxes_mask=True)
outputs = generator(img, points_per_batch=1)

Can you tell me why this happens?

@NielsRogge
Copy link
Owner

Hi,

Perhaps you can check some weights using generator.model and see whether you're actually using your custom model.

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