Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masc-it/yolov5-api-rust
Rust API to run predictions with YoloV5 models.
https://github.com/masc-it/yolov5-api-rust
actix-web onnx rust yolov5
Last synced: 12 days ago
JSON representation
Rust API to run predictions with YoloV5 models.
- Host: GitHub
- URL: https://github.com/masc-it/yolov5-api-rust
- Owner: masc-it
- License: mit
- Created: 2022-07-16T15:20:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-04T20:51:09.000Z (almost 2 years ago)
- Last Synced: 2024-02-29T05:33:40.070Z (4 months ago)
- Topics: actix-web, onnx, rust, yolov5
- Language: Rust
- Homepage:
- Size: 26.4 KB
- Stars: 26
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-yolo-object-detection - masc-it/yolov5-api-rust - it/yolov5-api-rust?style=social"/> : Rust API to run predictions with YoloV5 models. (Other Versions of YOLO)
README
# YoloV5-API [WIP]
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](https://github.com/masc-it/yolov5-api-cpp)
## Requirements
- [OpenCV 4.5.5](https://github.com/opencv/opencv/releases/tag/4.5.5) installed on your system
- Follow [Rust opencv README](https://github.com/twistedfall/opencv-rust)## Model config
**Data** directory must contain your config.json
**config.json** defines:
- ONNX absolute model path
- input size (640 default)
- array of class namesA dummy example is available in the _data/_ folder
## Docker
docker run --name rust-yolov5-api -v :/app/data -p 5000:5000 mascit/rust-yolov5-api:latest
## Build
Development:
cargo build
Release:
cargo build --release
## Run
cargo run
For Windows users: Assure to have _opencv_world455.dll_ in your exe directory.
# Endpoints
## /predict [POST]
### Body
- Image bytes (binary in Postman)### Headers
- 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