mermoldy / image-ssd

A Rust library for object detection via SSD MobileNet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image SSD

Build License: MIT

A Rust library for object detection via SSD MobileNet.

Usage

let src_img_path = &std::path::Path::new("images/example.jpg");
let src_img = image::open(&src_img_path)?;

let ssd_graph = image_ssd::get_or_load_ssd_mobilenet_v2_graph()?;
let ssd_net = image_ssd::SSDMobileNetV2::load(&ssd_graph)?;
let ssd_boxes = ssd_net.shot(&src_img)?;

let dest_img_path = &std::path::Path::new("images/example-out.png");
let dst_img = image_ssd::ImageBoxes::new()
    .border(image_ssd::Color::rgb8(0xBF, 0x90, 0x00), 3.0)
    .font("Arial", 24.0)
    .score(0.5)
    .draw(&src_img, ssd_boxes)?;
dst_img.save_with_format(&dest_img_path, image::ImageFormat::Png)?;

Input

Input

Output

Output

About

A Rust library for object detection via SSD MobileNet.

License:MIT License


Languages

Language:Rust 100.0%