This web application allows you to detect and anonymize faces using the Local Binary Patterns (LBP) technique, and also performs object detection using the Scale-Invariant Feature Transform (SIFT) technique. The system consists of a backend in Flask with Flask-SocketIO for real-time processing and streaming, and a frontend that displays the processed images along with performance statistics.
proyectoFinal/ β βββ app.py # Main Flask server file βββ modelo/ # Cascade.xml file for LBP βββ static/ # Static resources (CSS, images, logos) βββ templates/ # HTML files for frontend (dashboard.html, sift.html) βββ README.md # Project documentation
- Python 3.8 o superior
- Flask
- Flask-SocketIO
- OpenCV
- NumPy
- eventlet
- psutil
Install the dependencies with:
pip install flask flask-socketio opencv-python numpy eventlet psutilTo start the unified server that serves the dashboard and real-time streaming, run:
python3 main.pyThis will start the Flask server at:
http://0.0.0.0:5000-
Receives frames captured by the mobile server (which accesses the camera) and sends them via WebSocket.
-
Processes the frames using LBP to detect and pixelate faces, thereby protecting privacy.
-
Processes the frames using SIFT to detect and locate objects by matching them with a reference logo.
-
Streams the processed frames to the frontend for real-time visualization.
-
Sends real-time statistics of FPS and server memory usage for performance monitoring.
π Frontend Visualization
The frontend displays:
-
Live video with detected and anonymized faces (LBP).
-
Live video with object detection using SIFT.
-
Performance indicators: FPS and memory usage in MB.