Expand description
Segment Anything Model (SAM)
SAM is an architecture for image segmentation, capable of segmenting any object in an image based on prompts like points or boxes. //! This model provides a robust and fast image segmentation pipeline that can be tweaked via some prompting (requesting some points to be in the target mask, requesting some points to be part of the background so not in the target mask, specifying some bounding box).
- ⚡ Interactive Wasm Example
- 💻 GH Link
- 📝 Paper
- 💡 The default backbone can be replaced by the smaller and faster TinyViT model based on MobileSAM.
§Example
cargo run --example segment-anything --release -- \
--image candle-examples/examples/yolo-v8/assets/bike.jpg
--use-tiny --point 0.6,0.6 --point 0.6,0.55
Original; Prompt with
--point 0.6,0.55; Prompt with--point 0.6,0.6 --point 0.6,0.55
Re-exports§
pub use crate::models::with_tracing::Linear;