https://github.com/mxmgorin/cv-inference
Object detection (YOLO11 + ONNX Runtime): a REST API and annotation CLI on a reusable library
https://github.com/mxmgorin/cv-inference
axum computer-vision docker inference machine-learning object-detection onnx onnxruntime ort rest-api rust tokio yolo yolo11
Last synced: 9 days ago
JSON representation
Object detection (YOLO11 + ONNX Runtime): a REST API and annotation CLI on a reusable library
- Host: GitHub
- URL: https://github.com/mxmgorin/cv-inference
- Owner: mxmgorin
- Created: 2026-07-08T20:02:16.000Z (12 days ago)
- Default Branch: main
- Last Pushed: 2026-07-09T10:41:55.000Z (12 days ago)
- Last Synced: 2026-07-09T12:13:12.195Z (11 days ago)
- Topics: axum, computer-vision, docker, inference, machine-learning, object-detection, onnx, onnxruntime, ort, rest-api, rust, tokio, yolo, yolo11
- Language: Rust
- Homepage:
- Size: 1010 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Roadmap: docs/roadmap.md
Awesome Lists containing this project
README
# CV Inference (Rust + YOLO + ONNX)
[](https://github.com/mxmgorin/cv-inference/actions/workflows/ci.yml)
[](https://www.rust-lang.org)
Object detection in Rust built around a pre-trained **YOLO11** ONNX model run
via **ONNX Runtime**. It's organised as a small reusable detection library with
two front-ends on top:
- 🌐 a **REST API** (Axum) that returns detections as JSON, and
- 🖼️ an **`annotate` CLI** that draws the detected boxes onto an image.
## Demo

Boxes and labels above were drawn by the bundled `annotate` tool from the
service's own detections. Regenerate it (or annotate any image) with:
```bash
cargo run --release --features draw --bin annotate -- path/to/image.jpg out.jpg
# or reproduce the demo above:
./scripts/demo.sh
```
Sample photo: [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Crossing_marked_with_a_traffic_sign_20190517_184744_HDR.jpg) (CC0).
## Quick start
```bash
# 1. download the model (~11 MB) into models/
./scripts/get_model.sh
# 2. build (the first build also downloads & statically links ONNX Runtime)
cargo build --release
# 3. run
./target/release/cv-inference
# listening on http://0.0.0.0:8080
```
In another terminal:
```bash
curl -F "file=@cat.jpg" http://localhost:8080/detect
```
```json
{
"objects": [
{
"class": "person",
"confidence": 0.97,
"bbox": { "x": 124.0, "y": 80.0, "width": 200.0, "height": 450.0 }
}
]
}
```
## Documentation
- [Architecture](docs/architecture.md) — design, project layout, inference pipeline, logging
- [API reference](docs/api.md) — endpoints, request/response formats, errors
- [Configuration](docs/configuration.md) — model download, `config.yaml`, environment variables
- [Deployment](docs/deployment.md) — local build & run, Docker
- [Roadmap](docs/roadmap.md) — planned / future improvements