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

Performance Discrepancy Between SAM Model Demo and GitHub Code #762

Open
i-am-invincible opened this issue Jun 18, 2024 · 7 comments
Open

Comments

@i-am-invincible
Copy link

i-am-invincible commented Jun 18, 2024

Hi, I am working on segmenting car bodies in images using the Meta SAM model. I am facing a significant difference in performance between the UI demo on the official website and the code provided on the GitHub repository. UI demo performed remarkably well with just 1-2 clicks, however, when I attempted to use the code, results are very different and bad. Despite of providing multiple points, the results were not up to the mark as compared to the demo.

Using SAM Model Version:- "vit_h"
Used predictor_example file:- notebooks/predictor_example.ipynb

Examples:
Image 1:
Original Image:
image3

UI Demo Segmentation: - Performed well with 4 foreground points and 3 background points.
resized_sam_ui_3

My Code Segmentation: - Poor results with the same point placement.
code_output_3

Image 2:
Original Image:
image2

UI Demo Segmentation: - Good results with 4 foreground points and 4 background points.
resized_sam_ui_2

My Code Segmentation: - Poor results with the same point placement.
code_output_2

I would appreciate any insights into why this discrepancy is happening.
Could it be related to hidden hyperparameter settings, optimizers, or learning rates used in the UI demo that aren't included in the GitHub code?
If this is the case, would it be possible to provide some guidance.

@zhywyt
Copy link

zhywyt commented Sep 4, 2024

I have the same question.

@M3LLI55X
Copy link

same problem

@scchess
Copy link

scchess commented Sep 13, 2024

Same issue.

@facundoq
Copy link

The online and library versions are probably using different hyperparamters. Checkout this notebook: https://github.com/facebookresearch/segment-anything/blob/main/notebooks/automatic_mask_generator_example.ipynb

@scchess
Copy link

scchess commented Sep 17, 2024

What exactly to check in the notebook?

@facundoq
Copy link

facundoq commented Sep 17, 2024 via email

@zhchlong
Copy link

same question.

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

7 participants
@facundoq @scchess @M3LLI55X @i-am-invincible @zhchlong @zhywyt and others