Skip to content

Vjay15/Face_Check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face_Check

A real-time face verification system that compares faces from ID cards with live camera feed using advanced face recognition technology.

Sample Demo

Sample Demo

Sample ID used

Sample ID

Features

  • Real-time Face Recognition: Live camera feed with instant face matching
  • ID Card Processing: Upload and extract faces from ID cards or photos
  • High Accuracy: Uses InsightFace's ArcFace Buffalo model for precise face embeddings
  • User-friendly Interface: Clean Streamlit web interface
  • Similarity Scoring: Shows confidence scores for face matches
  • Instant Feedback: Visual indicators (green for match, red for no match)

Technology Stack

  • InsightFace: State-of-the-art face recognition and analysis
  • OpenCV: Computer vision and image processing
  • Streamlit: Web application framework
  • StreamLit-WebRTC: Real-time video streaming
  • SciPy: Distance calculations for face similarity
  • NumPy: Numerical operations

Installation

  1. Clone the repository:

    git clone https://github.com/Vjay15/Face_Check.git
    cd Face_Check
  2. Install required dependencies:

    pip install -r requirements.txt

Usage

  1. Start the application:

    streamlit run app.py
  2. Upload ID Card:

    • Click "Upload your ID Card" in the left panel
    • Select a JPG, JPEG, or PNG file containing a clear face
    • The system will automatically extract and display the face
  3. Live Verification:

    • Once an ID is uploaded, the face will be extracted and click on start, to start the camera feed
    • Position your face in front of the camera
    • The system will show real-time similarity scores
    • Green box = Match found
    • Red box = No match

How It Works

  1. Face Extraction: Uses OpenCV's CascadeClassifier and HaarCascade Algorithm to detect and extract faces
  2. Face Detection: Uses InsightFace's Buffalo model to detect faces in uploaded images
  3. Feature Extraction: Generates normalized face embeddings for comparison
  4. Real-time Processing: Continuously processes camera frames for face detection
  5. Similarity Calculation: Uses cosine distance to measure face similarity
  6. Threshold Matching: Considers faces with >60% similarity as matches

Configuration

  • Similarity Threshold: Currently set to 0.6 (60% similarity)
  • Camera Resolution: 720x200 pixels output for optimal performance
  • Processing: Configured for GPU acceleration (falls back to CPU)

Supported File Formats

  • Input Images: JPG, JPEG, PNG
  • Camera: Any webcam compatible with WebRTC

Requirements

  • Python 3.7+
  • Webcam/Camera access
  • Modern web browser with WebRTC support

License

This project is open source and available under the MIT License.

Acknowledgments

  • InsightFace team for the excellent, compact and highly efficient face recognition models
  • OpenCV community for computer vision tools
  • Countless Medium articles and Blogs of people that taught me how these algorithms worked!

About

A Face verification system built on top of insightface, OpenCV and Streamlit.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages