Skip to content

Latest commit

Β 

History

History
68 lines (56 loc) Β· 1.88 KB

File metadata and controls

68 lines (56 loc) Β· 1.88 KB

🧠 Human Tracker with YOLO + Telegram Bot

A human detection and tracking app using YOLO to identify and track people through a camera. It automatically sends images to Telegram when a new person is detected.


πŸš€ Features

  • πŸ“¦ Human detection using YOLOv11
  • 🧍 Multi-person tracking (multi-id)
  • πŸ€– Send images via Telegram bot when a new person is detected
  • 🐳 Can run with either Python (venv) or Docker

πŸ“ Project Structure

CameraTracking/
β”œβ”€β”€ main.py                # Main entry point
β”œβ”€β”€ telegram_bot.py        # Controls the Telegram bot
β”œβ”€β”€ human_tracker.py       # YOLO + tracking handling class
β”œβ”€β”€ requirements.txt       # Required libraries
β”œβ”€β”€ Dockerfile             # For running with Docker
β”œβ”€β”€ .dockerignore          # Files to ignore during Docker build
└── HumanImage/            # Folder to store detected human images

βš™οΈ Telegram Bot Setup

  1. Create a bot through @BotFather
  2. Retrieve the token and insert it into the code (.env)
  3. Get your chat_id by either chatting with the bot or using the Bot API

πŸ§‘β€πŸ’» 1. Running with Python + Virtualenv

✏️ Step 1: Create a virtual environment

python -m venv venv
source venv/bin/activate      # For Linux/macOS
venv\Scripts\activate         # For Windows

πŸ“¦ Step 2: Install dependencies

pip install -r requirements.txt

▢️ Step 3: Run the app

python main.py

🐳 2. Running with Docker

πŸ“¦ Step 1: Build the Docker image

docker build -t human-tracker-bot

▢️ Step 2: Run the Docker container

docker run --rm human-tracker-bot

πŸ‘‰ If you’re using a camera on Linux:

docker run --rm --device=/dev/video0 human-tracker-bot

πŸ“Œ Notes

  • Detected images are saved in the HumanImage/ folder.
  • Press q in the display window to exit the program.