Skip to content

SpectralProgrammer/CrimeSnap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CrimeSnap

🔍 Criminal Facial Recognition Software with Realtime Database

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.


🌟 Key Features

  • 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

🚀 Future Potential

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.


💡 Feedback & Contributions

If you have suggestions or discover issues, please submit them via the Issues tab. Your input is appreciated!


📦 Installation

✅ Prerequisites

  • Python 3.x installed on your machine

📥 Install Dependencies

pip install firebase
pip install opencv-python
pip install face-recognition

🔧 Setting Up Firebase Realtime Database

  1. Visit Firebase Console
  2. Click "Create a Project" and follow the prompts
  3. Under Build, select Realtime Database and create your database
  4. Copy the database reference URL and set it as databaseURL in main.py
  5. Go to Project Settings → Service Accounts
  6. Select Python, then click "Generate New Private Key"
  7. Rename the downloaded file to serviceAccountKey.json
  8. Move serviceAccountKey.json into the root directory of your project

📁 Getting Started

Clone the Repository and Set Up Your Project

mkdir CrimeSnap
cd CrimeSnap
git clone https://github.com/SD-Coder24/CrimeSnap.git

➕ Adding Data to Firebase

🧪 Method 1: Manual Data (in-code, only if you have small amount of data)

Edit 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)

📂 Method 2: Load Data from data.json

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)

🧪 Example Use Case

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages