This repository presents a computer vision system developed to automate student gate entry at IIIT Delhi after 10 PM, designed to handle low-light conditions and real-world surveillance settings. The project integrates face detection, recognition, and temporal tracking from CCTV footage to log student entries seamlessly into an online database. The project was developed for the Computer Vision course at IIIT Delhi in Winter 2025.
- Low-Light Face Detection: DAI detector for robust face bounding box localization under challenging illumination.
- Face Recognition Backbone: MTCNN for alignment + AdaFace (quality-adaptive margin) for identity prediction.
- Temporal Consistency via Tracking: ByteTrack to link detections across frames, with majority-vote merging to reduce ID fragmentation & for tracking multiple individuals in video streams.
- Pipeline Optimizations:
- Frame skipping + interpolation for faster inference.
- TorchVision’s optimized NMS for efficiency.
- Quantized detector (FP16) for reduced GPU memory usage.
- Frontend Dashboard: React + TypeScript web interface with:
- Dashboard Panel: Shows entry/exit logs (name, roll no., photo, timestamp).
- Live Surveillance Panel: Displays real-time CCTV feeds.
- FastAPI Backend: REST API and WebSocket support for live frame streaming and event logging.
- Accuracy: Achieved 87.5% recognition accuracy under low-light conditions with near real-time inference.
- Clone the repository and install the following Python libraries:
pip install fastapi uvicorn opencv-python torch torchvision numpy Pillow sqlite3 scipy python-multipart python-dotenv requests matplotlib scikit-learn- Download the pretrained weights listed below and place them in
/weightsfolder: - Run the backend:
python app.py- Start the frontend:
cd frontend
npm install
npm start- Process videos:
- Place your video files in the root directory & edit the
vid_namevariable inmain.py - Run:
python main.py
- Output videos will be saved with
_complete.mp4,_lessdet.mp4, or_merge.mp4suffixes.
- Place your video files in the root directory & edit the
- Dataset not released for privacy.
/adaface: AdaFace identity recognition implementation./bytetrack: ByteTrack multi-object tracker./frontend: React + TypeScript web dashboard./weights: Pretrained model weights (to be downloaded)./data,/layers,/networks: Supporting modules, scripts & configs.app.py: FastAPI backend server.dai.py: DAI low-light face detection model.main.py: Complete pipeline,main_lessdet.py,main_merge.py: Batch video processing scripts - complete pipeline, reduced detection, and ID merge.
- Face Detection (DAI) under low-light conditions: F1-score = 0.86
- Face Recognition (AdaFace): Accuracy = 87.5%
- Pipeline Latency: Optimized from ~2 min to 8.3s for a 7s video (30 fps)
My IIIT Delhi batchmates Manan Aggarwal & Souparno Ghose also contributed in this project.
We gratefully acknowledge the open-source repositories that formed the backbone of this project:
- DAI: Boosting Object Detection with Zero-Shot Day-Night Domain Adaptation
- AdaFace: Quality Adaptive Margin for Face Recognition
📌 Important: Please make sure to follow the guidelines and policies outlined by the institution regarding the use of shared coursework materials. Use this repository responsibly and avoid any violations of academic integrity. Codes are provided for reference purposes only. It's recommended to understand the codes and implement them independently.

