CV / ByteTrack

ByteTrack

reComputer R Series (CM5 + Hailo-8)

MOT17 pedestrian tracking with ByteTrack-S / Tiny / Nano / M on reComputer R Series with Hailo-8 or Hailo-10H.

17 downloads
Size
14.8 MB
Memory
4GB+
Precision
Hailo HEF

Choose the device you're using, the set up guide and documentation will update accordingly.

Getting Started

Deploy
sudo docker run --rm \
  --name pi5-hailo8-bytetrack-s \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_s_mot17:latest \
  python web_detection.py --model_path model/bytetrack_s_mot17.hef --video_path video/test.mp4

Model Details

reComputer R Series (CM5 + Hailo-8)

ByteTrack-S / ByteTrack-Tiny MOT17 Tracking on reComputer R Series (CM5 + Hailo-8)

ByteTrack-S, ByteTrack-Tiny, ByteTrack-Nano and ByteTrack-M track people on MOT17-style video on Hailo-8 through HailoRT 4.23. The HEFs are YOLOX-style person detectors; the host runs the nine-head decode, NMS and ByteTrack association (Kalman prediction plus high/low-score IoU matching), then draws a stable track ID on the MJPEG preview.

Model Info

VariantInputPackaged HEFMOTA float / Hailo-8FPS (batch 1)Params / OpsContainer
ByteTrack-S608×1088×314.8 MB79.5 / 77.788.38.94M / 43.21Gbytetrack_s_mot17
ByteTrack-Tiny608×1088×39.7 MB77.2 / 76.01265.03M / 24.60Gbytetrack_tiny_mot17
ByteTrack-Nano608×1088×39.8 MB70.1 / 69.063.70.90M / 4.12Gbytetrack_nano_mot17
ByteTrack-M608×1088×381.4 MB86.2 / 86.111.125.28M / 206.12Gbytetrack_m_mot17

Hardware and Host Setup

ItemValue
BoardreComputer R Series with Raspberry Pi CM5
AcceleratorHailo-8 over PCIe, exposed as /dev/hailo0
RuntimeHailoRT 4.23.x (host / container must share major.minor)
Python in container3.11, aarch64
bash
sudo apt update
sudo apt install hailo-all -y
sudo reboot

# After reboot
hailortcli fw-control identify
ls /dev/hailo0

# Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh --mirror Aliyun
sudo systemctl enable docker
sudo systemctl start docker

Run With Demo Video

Select the command matching the model variant. The bundled video/test.mp4 is Hailo's example.mp4 street-scene demo clip.

ByteTrack-S

bash
sudo docker run --rm \
  --name pi5-hailo8-bytetrack-s \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_s_mot17:latest \
  python web_detection.py --model_path model/bytetrack_s_mot17.hef --video_path video/test.mp4

ByteTrack-Tiny

bash
sudo docker run --rm \
  --name pi5-hailo8-bytetrack-tiny \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_tiny_mot17:latest \
  python web_detection.py --model_path model/bytetrack_tiny_mot17.hef --video_path video/test.mp4

ByteTrack-Nano

bash
sudo docker run --rm \
  --name pi5-hailo8-bytetrack-nano \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_nano_mot17:latest \
  python web_detection.py --model_path model/bytetrack_nano_mot17.hef --video_path video/test.mp4

ByteTrack-M

bash
sudo docker run --rm \
  --name pi5-hailo8-bytetrack-m \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_m_mot17:latest \
  python web_detection.py --model_path model/bytetrack_m_mot17.hef --video_path video/test.mp4

USB Camera Mode

bash
sudo docker run --rm \
  --name pi5-hailo8-bytetrack-s \
  --privileged \
  --net=host \
  -e PYTHONUNBUFFERED=1 \
  --device /dev/hailo0:/dev/hailo0 \
  --device /dev/video0:/dev/video0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_s_mot17:latest \
  python web_detection.py --model_path model/bytetrack_s_mot17.hef --camera_id 0

Swap bytetrack_s_mot17 for bytetrack_tiny_mot17 to use the Tiny variant.

REST API

VariantEndpoint
ByteTrack-SPOST /api/models/bytetrack_s_mot17/predict
ByteTrack-TinyPOST /api/models/bytetrack_tiny_mot17/predict
ByteTrack-NanoPOST /api/models/bytetrack_nano_mot17/predict
ByteTrack-MPOST /api/models/bytetrack_m_mot17/predict
bash
curl -X POST "http://<Board_IP>:8000/api/models/bytetrack_s_mot17/predict" \
  -F "file=@test.jpg"

Returns predictions entries with track_id, class, confidence and box.

Implementation Notes

  • The HEFs expose nine YOLOX-style heads: box(4), objectness(1) and class(1) for strides 32, 16 and 8. There is no on-chip NMS.
  • Host decode: center = (raw_xy + grid) * stride, size = exp(raw_wh) * stride, score = obj * class (the HEF already applies sigmoid). Boxes are kept at 0.1 and NMS is 0.7.
  • ByteTrack association uses Kalman prediction plus high-score and low-score IoU matching; only activated tracks are drawn.
  • Pre-processing letterboxes to 608×1088 with padding 114 and converts BGR to RGB; ImageNet normalization is compiled into the HEF.
  • This is a person-only MOT17 detector, not a generic 80-class detector.

Development Notes

  • Sources: src/rpi5_hailo8_bytetrack_{s,tiny,nano,m}_mot17/
  • Dockerfiles: docker/hailo8/bytetrack_{s,tiny,nano,m}_mot17.dockerfile
  • Containers: ghcr.io/seeed-projects/recomputer-hailo8-cv/bytetrack_{s,tiny,nano,m}_mot17:latest
  • HEFs: Hailo Model Zoo v2.20.0 (hailo8), sizes and SHA256 recorded in each module's model/README.md
  • Tracker: host-side ByteTrack port in each module's py_utils/byte_tracker.py

Inputs and Outputs

Input: image, video, or USB camera frame. Output: person boxes with confidence and track IDs, plus an annotated MJPEG preview.