Skip to content

Mahan1341/Home_FaceRecognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Intercom Unlock System

Computer Vision system for automatic door unlocking using face recognition and UI automation.

Overview

This project implements an end-to-end pipeline that:

  1. Captures live video from an emulator window
  2. Detects a face in the frame
  3. Computes face embeddings using a deep neural network (ArcFace ONNX)
  4. Compares embeddings with a reference identity
  5. Detects the "Open Door" button using template matching
  6. Automatically clicks the button when the authorized person is detected

Pipeline

Screen Capture (mss)
        ↓
Face Detection (OpenCV Haar Cascade)
        ↓
Face Embedding (ArcFace ONNX)
        ↓
Similarity Check (Cosine Similarity)
        ↓
Button Detection (Template Matching)
        ↓
Automation (pyautogui click)

Tech Stack

  • Python
  • OpenCV
  • ONNX Runtime (GPU supported)
  • NumPy
  • MSS (screen capture)
  • PyAutoGUI (automation)
  • PyGetWindow

Emulator-Based Integration

The system operates through a mobile application running inside an Android emulator (e.g., BlueStacks / LDPlayer).

Since no public API is available for the intercom system, the solution uses:

  • Screen capture of the emulator window
  • Computer Vision for video stream processing
  • UI automation to interact with the app

Why emulator?

  • No official API access
  • Closed mobile application
  • Need to automate real user interaction

This approach allows building a fully functional system without modifying the original application.


Setup

1. Clone repository

git clone https://github.com/Mahan1341/Home_FaceRecognition.git
cd Home_FaceRecognition

2. Install dependencies

pip install opencv-python numpy mss pyautogui pygetwindow onnxruntime-gpu

3. Download models

Download ArcFace model:

https://github.com/deepinsight/insightface/releases

Required file:

w600k_r50.onnx

Place it into:

models/w600k_r50.onnx

4. Prepare your face data

Add your image:

me_1.jpg

5. Run

python main.py

Configuration

You can tune thresholds in code:

FACE_THRESHOLD = 0.5
BUTTON_THRESHOLD = 0.8
GLOBAL_COOLDOWN = 20

Notes

  • Face recognition is based on cosine similarity between embeddings
  • Thresholds are chosen empirically
  • System works in real-time

Limitations

  • Haar Cascade face detector is not robust
  • No anti-spoofing (photo/video attacks possible)
  • UI detection depends on button appearance

Demo

TODO


Project Motivation

This project demonstrates:

  • Computer Vision
  • Deep Learning inference
  • Real-world system integration
  • Automation

Author

Mahan1341

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages