Computer Vision system for automatic door unlocking using face recognition and UI automation.
This project implements an end-to-end pipeline that:
- Captures live video from an emulator window
- Detects a face in the frame
- Computes face embeddings using a deep neural network (ArcFace ONNX)
- Compares embeddings with a reference identity
- Detects the "Open Door" button using template matching
- Automatically clicks the button when the authorized person is detected
Screen Capture (mss)
↓
Face Detection (OpenCV Haar Cascade)
↓
Face Embedding (ArcFace ONNX)
↓
Similarity Check (Cosine Similarity)
↓
Button Detection (Template Matching)
↓
Automation (pyautogui click)
- Python
- OpenCV
- ONNX Runtime (GPU supported)
- NumPy
- MSS (screen capture)
- PyAutoGUI (automation)
- PyGetWindow
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
- 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.
git clone https://github.com/Mahan1341/Home_FaceRecognition.git
cd Home_FaceRecognition
pip install opencv-python numpy mss pyautogui pygetwindow onnxruntime-gpu
Download ArcFace model:
https://github.com/deepinsight/insightface/releases
Required file:
w600k_r50.onnx
Place it into:
models/w600k_r50.onnx
Add your image:
me_1.jpg
python main.py
You can tune thresholds in code:
FACE_THRESHOLD = 0.5
BUTTON_THRESHOLD = 0.8
GLOBAL_COOLDOWN = 20
- Face recognition is based on cosine similarity between embeddings
- Thresholds are chosen empirically
- System works in real-time
- Haar Cascade face detector is not robust
- No anti-spoofing (photo/video attacks possible)
- UI detection depends on button appearance
TODO
This project demonstrates:
- Computer Vision
- Deep Learning inference
- Real-world system integration
- Automation
Mahan1341