This repository contains two integrated AI projects for computer vision-based CCTV surveillance: Person Tracker with Re-Identification and YOLO Model for Detection and Face Recognition. The system is designed for real-time person tracking, object detection, and face recognition in video feeds, suitable for security applications like monitoring snatching or unauthorized access.
- Purpose: Tracks persons across multiple camera feeds using re-identification (ReID) techniques.
- Key Features:
- Multi-camera person tracking.
- Re-identification using deep learning models.
- Outputs matched images and comparisons.
- Technologies: Python, OpenCV, Deep Learning (ReID models).
- Purpose: Object detection and face recognition using YOLO (You Only Look Once) models.
- Key Features:
- Detection of objects (e.g., persons, bags) in videos.
- Face detection and recognition with known faces.
- Dataset training and testing for custom models.
- Technologies: Python, YOLOv8/YOLOv11, Face Recognition libraries.
The projects are interconnected: YOLO models can be used for initial detection in the person tracker.
- Python 3.8+
- Git
- Virtual environment (recommended)
git clone https://github.com/RohiBit/AI_Security.git
cd ai-cam # Replace with your repo namepython -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activateFor Person Tracker:
cd person-tracker
pip install -r requirements.txtFor YOLO Model:
cd ../yolo_model
pip install -r requirements.txt- YOLO models (.pt files) need to be downloaded separately (e.g., from Ultralytics or your source) and placed in appropriate directories (e.g.,
person-tracker/models/oryolo_model/script/). - Face recognition encodings may need training if
known_faces_encodings.pklis missing.
- Place input videos in
person-tracker/videos/or reference them in scripts. - Run the tracker:
python tracker.py # Adjust paths as needed - Outputs will be in
person-tracker/output/.
- For detection:
python script/test_yolo.py
- For face recognition:
python face_detection/train.py # To train on known faces python face_detection/test.py # To test recognition
- Dataset: Use
dataset/data.yamlfor training custom models.
ai-cam/
├── README.md
├── .gitignore
├── person-tracker/
│ ├── requirements.txt
│ ├── tracker_reid.py
│ ├── tracker.py
│ ├── input/
│ │ └── target_fullbody.jpg
│ └── reid_model/
│ └── reid_engine.py
├── yolo_model/
│ ├── requirements.txt
│ ├── dataset/
│ │ └── data.yaml
│ ├── face_detection/
│ │ ├── 1.py
│ │ ├── download.py
│ │ ├── known_faces_encodings.pkl
│ │ ├── test.py
│ │ └── train.py
│ └── script/
│ ├── cam_test.py
│ ├── convert.py
│ ├── count.py
│ ├── extract_frames.py
│ ├── main.py
│ ├── simple_test.py
│ └── test_yolo.py
└── input/ # Sample input videos (optional)