0e6af155创建于 2024年12月15日历史提交
use segment_anything_rs::*;

fn main() {
    let model = SegmentAnything::builder().build().unwrap();
    let image = image::open("examples/landscape.jpg").unwrap();
    let x = image.width() / 2;
    let y = image.height() / 4;
    let images = model
        .segment_from_points(SegmentAnythingInferenceSettings::new(image).add_goal_point(x, y))
        .unwrap();

    images.save("out.png").unwrap();
}