segment_anything/
segment-anything.rs

1use segment_anything_rs::*;
2
3fn main() {
4    let model = SegmentAnything::builder().build().unwrap();
5    let image = image::open("examples/landscape.jpg").unwrap();
6    let x = image.width() / 2;
7    let y = image.height() / 4;
8    let images = model
9        .segment_from_points(SegmentAnythingInferenceSettings::new(image).add_goal_point(x, y))
10        .unwrap();
11
12    images.save("out.png").unwrap();
13}