From cc80e065e575bd1c5140b2f1be065aafa55f2aea Mon Sep 17 00:00:00 2001 From: Daniel Varga Date: Wed, 15 May 2024 13:17:20 +0200 Subject: [PATCH] Allow the threshold argumet to be negative in the segment-anything example (#2187) 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. --- candle-examples/examples/segment-anything/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/candle-examples/examples/segment-anything/main.rs b/candle-examples/examples/segment-anything/main.rs index 911442a5..10f65c66 100644 --- a/candle-examples/examples/segment-anything/main.rs +++ b/candle-examples/examples/segment-anything/main.rs @@ -39,7 +39,7 @@ struct Args { /// The detection threshold for the mask, 0 is the default value, negative values mean a larger /// mask, positive makes the mask more selective. - #[arg(long, default_value_t = 0.)] + #[arg(long, allow_hyphen_values = true, default_value_t = 0.)] threshold: f32, /// Enable tracing (generates a trace-timestamp.json file).