Wei Zhang
Published © Apache-2.0

How to Deploy YOLO Projects with reComputer AI Lab

Deploy YOLOv5/v8/v11 on Seeed reComputer RK edge boards via reComputer AI Lab’s prebuilt Docker containers; full workflow from Docker setup,

IntermediateFull instructions provided2 hours6
How to Deploy YOLO Projects with reComputer AI Lab

Things used in this project

Hardware components

reComputer RK3576
Seeed Studio reComputer RK3576
×1

Software apps and online services

VS Code
Microsoft VS Code

Story

Read more

Code

Operation Instructions

Python
{
 "cells": [
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "# Download official Docker installation script\n",
    "!curl -fsSL https://get.docker.com -o get-docker.sh\n",
    "\n",
    "# Install via Alibaba Cloud mirror (recommended for users in China)\n",
    "!sudo sh get-docker.sh --mirror Aliyun\n",
    "\n",
    "# Enable Docker auto-start on boot and launch the service\n",
    "!sudo systemctl enable docker\n",
    "!sudo systemctl start docker\n",
    "\n",
    "# Verify successful installation\n",
    "!sudo docker --version"
   ],
   "id": "a009f8d5721e6476"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "!sudo usermod -aG docker $USER",
   "id": "a8e0d61854d581f5"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "!docker ps",
   "id": "aad03a518a7f05ec"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "!sudo docker run --rm --privileged --net=host -e PYTHONUNBUFFERED=1 -e RKNN_LOG_LEVEL=0 --device /dev/video1:/dev/video1 --device /dev/dri/renderD129:/dev/dri/renderD129 -v /proc/device-tree/compatible:/proc/device-tree/compatible ghcr.io/seeed-projects/recomputer-rk-cv/rk3576-yolo11:latest python web_detection.py --model_path model/yolo11m.rknn --video video/test.mp4",
   "id": "e61c66ba56ac44fd"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "# Real-time camera streaming inference\n",
    "!curl -X POST \"http://127.0.0.1:8000/api/models/yolo11/predict\" -F \"realtime=true\"\n",
    "\n",
    "# Single-shot inference using default sample image\n",
    "!curl -X POST \"http://127.0.0.1:8000/api/models/yolo11/predict\"\n",
    "\n",
    "# Run detection on a custom local image file\n",
    "!curl -X POST \"http://127.0.0.1:8000/api/models/yolo11/predict\" -F \"file=@/home/cat/001.jpg\"\n",
    "\n",
    "# Run inference on a specific frame from a local video file\n",
    "!curl -X POST \"http://127.0.0.1:8000/api/models/yolo11/predict\" -F \"video=@/home/cat/test.mp4\" -F \"timestamp=5.5\""
   ],
   "id": "29fe8d67f0b13ad3"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "# YOLO11n: Fastest inference speed\n",
    "!python web_detection.py --model_path model/yolo11n.rknn --camera_id 1\n",
    "\n",
    "# YOLO11s: Balanced speed and accuracy\n",
    "!python web_detection.py --model_path model/yolo11s.rknn --camera_id 1\n",
    "\n",
    "# YOLO11m: Higher detection precision\n",
    "!python web_detection.py --model_path model/yolo11m.rknn --camera_id 1"
   ],
   "id": "3eaf2e3df76eda39"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "import cv2\n",
    "\n",
    "stream_url = \"http://192.168.1.100:8000/api/video_feed\"\n",
    "cap = cv2.VideoCapture(stream_url)\n",
    "\n",
    "while True:\n",
    "    ret, frame = cap.read()\n",
    "    if not ret:\n",
    "        break\n",
    "    cv2.imshow(\"Detection\", frame)\n",
    "    if cv2.waitKey(1) & 0xFF == ord('q'):\n",
    "        break\n",
    "\n",
    "cap.release()\n",
    "cv2.destroyAllWindows()"
   ],
   "id": "9c4e1e750dfd4cbe"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": [
    "import requests\n",
    "\n",
    "base_url = \"http://192.168.1.100:8000\"\n",
    "\n",
    "# Profile 1: High precision mode (reduce false detections)\n",
    "requests.post(f\"{base_url}/api/config\", json={\n",
    "    \"obj_thresh\": 0.5,\n",
    "    \"nms_thresh\": 0.4\n",
    "})\n",
    "\n",
    "# Profile 2: High recall mode (minimize missed objects)\n",
    "requests.post(f\"{base_url}/api/config\", json={\n",
    "    \"obj_thresh\": 0.2,\n",
    "    \"nms_thresh\": 0.5\n",
    "})\n",
    "\n",
    "# Profile 3: Dense crowd detection profile\n",
    "requests.post(f\"{base_url}/api/config\", json={\n",
    "    \"obj_thresh\": 0.3,\n",
    "    \"nms_thresh\": 0.35\n",
    "})"
   ],
   "id": "aa468d0d323f5577"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "!curl -X POST \"http://192.168.1.100:8000/api/models/yolo11/predict\" -F \"file=@test.jpg\" -F \"conf=0.6\" -F \"iou=0.3\"",
   "id": "7c39409fdc89fcad"
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 5
}

Credits

Wei Zhang
4 projects • 0 followers
AE
Thanks to Seeed Studio.

Comments