FastAPI service for synchronized multi-camera license plate detection + OCR, with MinIO image upload and WebSocket result streaming.
1python -m venv .venv
2source .venv/bin/activate
3pip install --upgrade pip
4pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
5pip install openvino msgpack
6pip install -r requirements.txt
1rtsp_urls:
2 - id: 11
3 url: /path/to/source1.mp4
4 - id: 12
5 url: rtsp://user:pass@camera/stream
6
7log_level: INFO
8endpoint: 0.0.0.0:9003
9access_key: minioadmin
10secret_key: minioadmin
11bucket: detector-frames
12dashboard_ws: ws://<dashboard-host>:8075
13upload_interval: 5
Create/replace config file (JSON or YAML body). Refuses update while service is running.
Start frame sync + processing + websocket server.
1{
2 "upload_interval": 5.0,
3 "download_verify": false,
4 "download_dir": "downloaded",
5 "target_width": 640
6}
Stop background processing.
Health + running flag.
Returns loaded YAML config + runtime config.
1{
2 "results": [
3 {
4 "cam_id": 11,
5 "ocr": "12A34567",
6 "confidence": 0.97,
7 "minio_path": "cam_11/2026-02-22/1740....jpg",
8 "bbox": [100, 200, 260, 260]
9 }
10 ]
11}
1curl -X POST http://localhost:8003/config \
2 -H "Content-Type: application/json" \
3 -d '{
4 "rtsp_urls": [
5 { "id": 11, "url": "/home/arshia/Downloads/parking-1.mp4" },
6 { "id": 12, "url": "/home/arshia/Downloads/video.mp4" }
7 ],
8 "log_level": "INFO",
9 "endpoint": "0.0.0.0:9003",
10 "access_key": "minioadmin",
11 "secret_key": "minioadmin",
12 "bucket": "detector-frames",
13 "dashboard_ws": "ws://192.168.7.119:8075",
14 "upload_interval": 5
15 }'
1curl -X POST http://localhost:8003/start \
2 -H "Content-Type: application/json" \
3 -d '{"upload_interval": 5.0, "download_verify": false}'