No description
Find a file
Jakob Lechner 40ce7946d5 Count each person just once
just once and either in or out
2025-08-02 04:19:26 +02:00
utils Count each person just once 2025-08-02 04:19:26 +02:00
yolo_weights initial commit 2025-07-16 14:23:13 +02:00
.envrc initial commit 2025-07-16 14:23:13 +02:00
.gitignore initial commit 2025-07-16 14:23:13 +02:00
bytetrack.yaml initial commit 2025-07-16 14:23:13 +02:00
flake.lock initial commit 2025-07-16 14:23:13 +02:00
flake.nix initial commit 2025-07-16 14:23:13 +02:00
LICENSE initial commit 2025-07-16 14:23:13 +02:00
main.py Replace streamlit with FastAPI 2025-08-02 03:25:54 +02:00
metrics.py Replace streamlit with FastAPI 2025-08-02 03:25:54 +02:00
README.md initial commit 2025-07-16 14:23:13 +02:00
requirements.txt Replace streamlit with FastAPI 2025-08-02 03:25:54 +02:00
tracker.py Replace streamlit with FastAPI 2025-08-02 03:25:54 +02:00

People Counter with YOLOv8, ByteTrack, and Prometheus

This project implements a real-time people counting system based on object detection and tracking using YOLOv8 and ByteTrack. It supports RTSP input, in/out counting using a vertical line, and exposes Prometheus metrics for integration with monitoring systems.

🚀 Features

  • 🎥 RTSP camera stream input
  • 🧠 YOLOv8 person detection
  • 🔁 ByteTrack object tracking
  • In/Out counting via virtual vertical line
  • 📊 Prometheus metrics at http://localhost:9100/
  • 🌐 Streamlit UI for live video and statistics

Start mediamtx

mediamtx

Stream webcam

ffmpeg \
    -vaapi_device /dev/dri/renderD128 \
    -y \
    -f v4l2 \
    -framerate 30 \
    -video_size 1280x720 \
    -input_format mjpeg \
    -i /dev/video0 \
    -vf 'format=nv12,hwupload' \
    -c:v h264_vaapi \
    -f rtsp \
    rtsp://localhost:8554/cam

Run application

streamlit run streamlit_app.py