API to run inferences with YoloV5 models. Written in Rust, based on OpenCV 4.5.5
If you need a C++ version, check my C++ Yolov5-API
- OpenCV 4.5.5 installed on your system
- Follow Rust opencv README
Data directory must contain your config.json
config.json defines:
- ONNX absolute model path
- input size (640 default)
- array of class names
A dummy example is available in the data/ folder
docker run --name rust-yolov5-api -v <model data dir>:/app/data -p 5000:5000 mascit/rust-yolov5-api:latest
Development:
cargo build
Release:
cargo build --release
cargo run
For Windows users: Assure to have opencv_world455.dll in your exe directory.
- Image bytes (binary in Postman)
- X-Confidence-Thresh
- default 0.5
- X-NMS-Thresh
- default 0.45
- X-Return
- image_with_boxes
- A JPEG image with drawn predictions
- json (default)
- A json array containing predictions. Each object defines: xmin, ymin, xmax, ymax, conf, class_name
- image_with_boxes