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

Allow the threshold argumet to be negative in the segment-anything example #2187

Conversation

vargad
Copy link
Contributor

@vargad vargad commented May 15, 2024

Threshold is 0.0 by default, negative values make more points included, expanding the mask. Positive values make it more picky, making the mask smaller.

Negative numbers start with a minus sign, which normally makes clap consider it a flag.

Without this change:

$ cargo run --example segment-anything -- --image assets/single_pt_prompt.jpg --point 0.5,0.5 --threshold -0.5
error: unexpected argument '-0' found

Usage: segment-anything [OPTIONS] --image <IMAGE>

For more information, try '--help'.

…ample

Threshold is 0.0 by default, negative values make more points included,
expanding the mask. Positive values make it more picky, making the mask
smaller.

Negative numbers start with a minus sign, which normally makes clap
consider it a flag.
@LaurentMazare LaurentMazare merged commit cc80e06 into huggingface:main May 15, 2024
10 checks passed
@LaurentMazare
Copy link
Collaborator

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants