CV / YOLOv7
YOLOv7
Select the lightweight YOLOv7-Tiny or full YOLOv7 model with the model-path parameter.
Choose the device you're using, the set up guide and documentation will update accordingly.
Getting Started
sudo docker run --rm --privileged --net=host --device /dev/dri/renderD128:/dev/dri/renderD128 \
-v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
ghcr.io/seeed-projects/recomputer-rk-cv/rk3576-yolov7:latest \
python3 web_detection.py --platform rk3576 --model_path model/yolov7-tiny.rknn \
--anchors model/anchors_yolov7.txt --video_path video/test.mp4REST API
Use the REST API to run inference. Copy the commands below.
curl http://localhost:8080/v1/chat/completions -d '{
"model": "yolov7-rknn",
"messages": [{"role": "user", "content": "Hello"}]
}'import requests
resp = requests.post(
"http://localhost:8080/v1/chat/completions",
json={"model": "yolov7-rknn", "messages": [{"role": "user", "content": "Hello"}]},
)
print(resp.json())Model Details
YOLOv7 on reComputer RK3576 and RK3588
This page documents the YOLOv7 RKNN service from
reComputer-RK-CV. It
supports COCO detection, browser preview, REST inference, camera input, and
offline MP4 processing.
Model information
| Property | Value |
|---|---|
| Task | COCO 80-class object detection |
| Input | 640 x 640, letterboxed and converted from BGR to RGB |
| Variants | yolov7-tiny.rknn, yolov7.rknn |
| Default | model/yolov7-tiny.rknn |
| Anchors | model/anchors_yolov7.txt |
Run the service
RK3576
sudo docker run --rm --privileged --net=host \
--device /dev/dri/renderD128:/dev/dri/renderD128 \
-v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
ghcr.io/seeed-projects/recomputer-rk-cv/rk3576-yolov7:latest \
python3 web_detection.py --platform rk3576 \
--model_path model/yolov7-tiny.rknn \
--anchors model/anchors_yolov7.txt --video_path video/test.mp4RK3588
sudo docker run --rm --privileged --net=host \
--device /dev/dri/renderD128:/dev/dri/renderD128 \
-v /proc/device-tree/compatible:/proc/device-tree/compatible:ro \
ghcr.io/seeed-projects/recomputer-rk-cv/rk3588-yolov7:latest \
python3 web_detection.py --platform rk3588 \
--model_path model/yolov7-tiny.rknn \
--anchors model/anchors_yolov7.txt --video_path video/test.mp4To use full YOLOv7, change only the model path to model/yolov7.rknn. Keep
the anchors argument. Use --camera_id -1 for upload-only mode.
Startup arguments
| Argument | Default | Description |
|---|---|---|
--platform | Required | rk3576 or rk3588. |
--model_path | Required | Tiny or full YOLOv7 RKNN file. |
--anchors | Required | Anchor file matching the converted model. |
--camera_id | 1 | Camera index; use -1 for uploads only. |
--video_path | None | Looping local MP4; overrides the camera. |
--class_path | COCO labels | Optional replacement class list. |
--host / --port | 0.0.0.0 / 8000 | Service address and port. |
REST API
Endpoint: POST /api/models/yolov7/predict
curl -X POST "http://<BOARD_IP>:8000/api/models/yolov7/predict" \
-F "file=@bus.jpg" -F "conf=0.25" -F "iou=0.45"{
"success": true,
"source": "uploaded image",
"predictions": [
{
"class": "bus",
"confidence": 0.92,
"box": {"x1": 100, "y1": 120, "x2": 520, "y2": 430}
}
],
"image": {"width": 640, "height": 480}
}The multipart interface accepts image, MP4-frame, and live-source requests.
GET/POST /api/config controls the default confidence and NMS thresholds.
Health, MJPEG, video upload, analysis, progress, list, and download endpoints
follow the standard service structure. Runtime files use workspace/ by
default. Replacement models need a matching anchor file, input size, class
configuration, and output layout.
Build locally
docker build -f docker/rk3576/yolov7.dockerfile \
-t rk3576-yolov7:local src/rk3576_yolov7
docker build -f docker/rk3588/yolov7.dockerfile \
-t rk3588-yolov7:local src/rk3588_yolov7Inputs and Outputs
Input: image, video frame, or camera frame. Output: COCO classes, confidence scores, and boxes.