Developed using Python, OpenCV, and Firebase
CrimeSnap is a facial recognition application that uses Python and OpenCV to detect and identify individuals based on uploaded reference images. Integrated with Google Firebase's Realtime Database, the application records the time and date whenever a known individual is detected in a live video feed (currently from a webcam).
Once the software identifies a face that matches one already uploaded into the system, it logs the spotting details in the cloud database, allowing for persistent tracking and monitoring. It only stores the face of uploaded reference images.
⚠️ This project is intended for educational and demonstrative purposes only. Please adhere to privacy laws and ethical considerations when working with facial recognition technologies.
- Real-time facial recognition using webcam input
- Automatic logging of detections (name, time, and date) to Firebase
- Simple data upload system for reference faces
- Modular Python-based architecture with OpenCV
- Firebase-backed database for persistent tracking
CrimeSnap has the potential to be integrated with security camera systems to enhance surveillance capabilities. By extending the system to capture real-time data such as location, it could help notify security teams of possible criminal sightings as they occur.
If you have suggestions or discover issues, please submit them via the Issues tab. Your input is appreciated!
- Python 3.x installed on your machine
pip install firebase
pip install opencv-python
pip install face-recognition
- Visit Firebase Console
- Click "Create a Project" and follow the prompts
- Under Build, select Realtime Database and create your database
- Copy the database reference URL and set it as databaseURL in main.py
- Go to Project Settings → Service Accounts
- Select Python, then click "Generate New Private Key"
- Rename the downloaded file to serviceAccountKey.json
- Move serviceAccountKey.json into the root directory of your project
Clone the Repository and Set Up Your Project
mkdir CrimeSnap
cd CrimeSnap
git clone https://github.com/SD-Coder24/CrimeSnap.gitEdit main.py with your dataset:
data = {
"Loki": {
"Crime": "Loki's Crime",
"Date of Spotting": "00-00-00",
"Time of Spotting": "00:00:00"
},
"Green Goblin": {
"Crime": "Green Goblin's Crime",
"Date of Spotting": "00-00-00",
"Time of Spotting": "00:00:00"
}
}
for key, val in data.items():
ref.child(key).set(val)If you're working with a larger dataset, save your data in a file called data.json and use the following code:
import json
with open("data.json") as json_file:
data = json.load(json_file)
for key, val in data.items():
ref.child(key).set(val)- Start the program
- Show a face that matches a reference image in your dataset
- The app will log the date and time to Firebase
- Data can be monitored and extended remotely in real-time