Facial Police is an advanced solution designed to reconstruct and enhance human faces from low-quality CCTV or surveillance video footage. Leveraging state-of-the-art AI models, this project significantly improves the quality and clarity of facial images, enabling reliable identification and 3D visualization in both forensic and security applications.
- Frame Extraction: Efficiently extracts frames from video using OpenCV for downstream facial detection and enhancement.
- Face Detection: Accurately detects and crops faces from each frame using MTCNN.
- Preprocessing: Aligns and normalizes faces to ensure consistent orientation and size.
- Facial Enhancement: Utilizes GAN-based models such as CodeFormer and GFPGAN to restore and enhance facial details.
- Feature Reconstruction: Deep learning techniques reduce blur and amplify critical facial features for superior clarity.
- Post-Processing: Integrates enhanced faces back into original frames to preserve temporal continuity.
- Real-Time Monitoring: Live face detection and recognition via OpenCV2 and the
face_recognitionlibrary. - Vector Database Integration: Detects and flags known suspects using a vector database for face recognition.
- 3D Face Reconstruction: Generates 3D face meshes using 3DDFA-V3 and RetinaFace for immersive 360-degree visualization.
- User-Friendly UI: Intuitive platform ("Facial-Police") for uploading footage, reconstructing faces, and analyzing results.
-
Frame Extraction:
- Extract video frames at regular intervals using OpenCV.
-
Face Detection:
- Detect faces in each frame with MTCNN and crop for enhancement.
-
Preprocessing:
- Align and normalize detected faces for uniformity.
-
Facial Enhancement (GAN-based):
- Pass cropped faces through CodeFormer and GFPGAN to improve resolution and restore details.
-
Feature Reconstruction:
- Use deep learning to sharpen facial features and reduce blur.
-
Post-Processing:
- Merge enhanced faces back into frames, maintaining original video continuity.
The result folder contains comparative outputs from both CodeFormer and GFPGAN models:
- GFPGAN Results: Side-by-side comparisons of original and enhanced images.
- CodeFormer Results: Comparative outputs for CodeFormer-enhanced faces.
- Python, OpenCV, MTCNN, face_recognition
- CodeFormer, GFPGAN (GAN-based face restoration)
- 3DDFA-V3, RetinaFace (3D mesh reconstruction)
- Streamlit/FastAPI (for UI/UX platform)
- Upload your CCTV footage or video to the platform.
- The system automatically extracts frames, detects faces, and enhances them using AI models.
- View and analyze the enhanced faces, compare with originals, and utilize 3D reconstruction for further inspection.
- Use live monitoring for real-time face recognition and suspect identification.
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request for discussion.