High performance detection service based on Yolov8 and implemented in rust.
- ⚡ Asynchronous processing of requests
- 🔍 Real time detection in real time
- 🎨 Support for images in basic format64
- 📊 Structured json output
- 🛡️ Robust management of errors
- 🔄 Optimized Prestimized Images
├── assets
│ └── coco_classes.txt # Coco classes for labeling
├── models
│ ├── coco_classes.txt # Classes configuration
│ ├── coco.yaml # Coco configuration
│ └── yolov8n.onnx # YOLO Model pre-trained with COCO dataset
├── outputs # Directory Output Predizioni
├── src
│ └── main.rs # Main source code
└── Dockerfile # Docker configuration
The service requires the following ambient variables:
RUST_LOG
: Logging level (es. "info", "debug")MODEL_PATH
: Path of the onnx modelCLASSES_PATH
: Classes' route routeHOST
: Service host (default: "0.0.0.0")PORT
: Service door (default: 5000)
cargo build --release
docker build -t yolo-prediction .
docker run -p 5000:5000 yolo-prediction
- URL:
/predict
- Metodo:
POST
- Body:
{ "image": "base64_encoded_image" }
- Risposta:
{ "detections": [ { "class": "person", "confidence": 0.95, "bbox": [x, y, width, height] } ] }
- URL:
/health
- Method:
GET
- Answer:
200 OK
- asynchronous processing to manage multiple requests
- uploading the model only once to startup
- Optimized Pretimized Images
- Configurable confidence Threshold (default: 0.25)
- The service uses Yolov8 in Onnx format for object detection
- Supports the 80 Coco Standard classes
- Optimized input size: 640x640 pixels