This project is a computer vision mini-project for real-time smart surveillance. It detects people with YOLOv8, tracks them with DeepSORT, estimates motion between frames, logs crowd statistics, and raises a simple crowd alert.
The repo is now organized so it can be shown on GitHub more cleanly:
detection.ipynb: notebook walkthrough and quick experimentationrun_surveillance.py: reusable script for real-time detection and trackingplot_people_log.py: plots people-count trends from the generated CSV logevaluate_predictions.py: optional evaluation script for labeled prediction CSVsevaluation_labels_template.csv: template for addingy_trueandy_predrequirements.txt: Python dependenciesarchive/: local dataset folder used only during experimentationassets/: README visuals such as banner, demo frame, and workflow diagram
A short academic-style abstract is available in PROJECT_ABSTRACT.md.
- Run the surveillance pipeline on webcam or video input.
- Save annotated output video and CSV logs.
- Plot people-count trends from the log.
- Optionally evaluate predictions with a labeled CSV file.
- Person detection using YOLOv8
- Multi-object tracking using DeepSORT
- Current visible people count
- Total unique tracked people count
- Basic frame-difference motion estimation
- Crowd alert based on configurable threshold
- CSV logging for later analysis
Create and activate a Python 3.10 environment, then install dependencies:
pip install -r requirements.txtThis project was tested with the Kaggle dataset below:
suryaprabhakaran2005/road-accidents-from-cctv-footages-dataset
You can download it with kagglehub using:
import kagglehub
# Download latest version
path = kagglehub.dataset_download(
"suryaprabhakaran2005/road-accidents-from-cctv-footages-dataset"
)
print("Path to dataset files:", path)The printed path is the local dataset folder on your machine, and it may differ from system to system.
jupyter notebook detection.ipynbUse webcam:
python run_surveillance.py --source 0Use a video file:
python run_surveillance.py --source path/to/video.mp4 --no-displayThis creates:
output.avi: annotated output videolog.txt: CSV log with frame, current people, total unique people, and motion level
python plot_people_log.py --log log.txtTo save the plot:
python plot_people_log.py --log log.txt --output people_plot.pngThis repository does not include a labeled validation file by default, so metrics are optional instead of fake.
To evaluate predictions:
- Copy
evaluation_labels_template.csv - Fill it with two columns:
y_trueandy_pred - Run:
python evaluate_predictions.py --csv evaluation_labels.csv- Do not push the full dataset folder to GitHub.
- Do not push generated outputs unless you want a small sample demo.
- If you submit this academically, keep the project story consistent: this repo is a surveillance / people tracking project, not accident severity classification.
- Add 2-3 screenshots or a short GIF in the final GitHub version for stronger presentation.
- Add demo media inside the
assets/folder before final sharing.
- Reusable Python scripts for running, plotting, and evaluation
- Optional evaluation template instead of fake metrics
- GitHub issue templates and PR template
- Lightweight GitHub Actions syntax check
git init
git add .
git commit -m "Initial smart surveillance project"
git branch -M main
git remote add origin <your-github-repo-url>
git push -u origin mainMAYANK PANDEY
This project is licensed under the MIT License. See the LICENSE file for details.


