An intelligent face recognition project applying selective mosaic blur with cyberpunk glitch effects to a registered individual's face and body in real-time, leaving others unaffected.

Case study
The Hacker CCTV Face Mosaic is an innovative application designed to provide selective, stylized privacy in real-time video feeds. It identifies a pre-registered individual's face and entire body, applying a distinctive mosaic blur with dynamic glitch effects, while leaving all other people in the frame completely unaffected. This project merges advanced computer vision with a unique Cyberpunk Hacker aesthetic, offering a modern take on surveillance interfaces. It exists to demonstrate sophisticated real-time AI processing for identity masking and to explore creative visual effects within a functional application.
AI Core (face_recognition, ultralytics YOLOv8-seg): These libraries form the intelligence of the application. face_recognition (based on dlib) provides robust and accurate facial landmark detection and encoding, essential for distinguishing the target individual. ultralytics, specifically YOLOv8-seg, enables precise instance segmentation, creating masks that closely follow body contours rather than crude bounding boxes. This precision is critical for the "selective blurring" feature.
GUI (PyQt6): PyQt6 is utilized for building the application's premium Dark Mode graphical user interface. It provides a modern, responsive, and cross-platform framework for user interaction, real-time video display, and dynamic control adjustments, ensuring a professional and intuitive user experience.
Processing (OpenCV, NumPy, Pillow): OpenCV is fundamental for handling real-time video streams, camera input, and a wide array of image processing operations, including applying blurs and filters. NumPy provides efficient numerical operations on image data arrays, crucial for performance. Pillow extends image processing capabilities, particularly useful for manipulating image pixels and layers.
This combination ensures a powerful synergy: AI for intelligent detection, PyQt6 for a sleek interface, and OpenCV/NumPy/Pillow for efficient real-time visual processing.
Selective Identity Blurring: Only the face and body of the individual registered in the reference_faces directory are blurred, providing targeted privacy.
Precise Instance Segmentation: Leverages YOLOv8-seg to generate accurate masks that conform to body contours, ensuring a natural and sophisticated blurring effect.
Glitch & CCTV Aesthetics: Features a modern surveillance interface complete with scanlines, a "REC" indicator, exposure scales, audio bars, and a grayscale mode for an authentic security camera look. It also incorporates chromatic aberration glitch effects and "UNKNOWN" target panels to enhance the Cyberpunk theme.
M1/M2 Optimization: Engineered for high performance on Apple Silicon, achieving 30+ frames per second through intelligent face detection caching and multi-threaded processing facilitated by PyQt6.
Configurable Settings: Users can adjust various parameters, including the blur mode (segmentation for accuracy vs. bounding box for speed), mosaic pixelation intensity, face recognition sensitivity, and toggle a grayscale filter.
Real-time Performance Optimization: A significant challenge was ensuring the application could run smoothly at 30+ FPS, especially on resource-intensive tasks like simultaneous face recognition and instance segmentation, even on optimized hardware like Apple Silicon. This required careful implementation of caching mechanisms and multi-threading.
Accurate and Reliable AI Integration: Integrating and orchestrating multiple AI models (face recognition and YOLOv8-seg) to work seamlessly in real-time, accurately identifying a specific person and segmenting their body across varying lighting, poses, and backgrounds, presented a complex challenge.
Sophisticated GUI and Visual Effects: Developing a responsive PyQt6 GUI that not only displays real-time video but also overlays complex, dynamic visual effects (scanlines, glitches, custom UI elements) without degrading performance was demanding.
Integrating Advanced Computer Vision Pipelines: Gained deep experience in combining and orchestrating multiple sophisticated AI models (face recognition, instance segmentation) into a single, cohesive real-time application.
Performance Optimization for AI: Learned practical techniques for optimizing AI-driven applications, including strategic caching and leveraging multi-threading with GUI frameworks like PyQt6 to achieve high frame rates.
Interactive GUI Development with Real-time Feeds: Enhanced skills in developing complex, interactive graphical user interfaces using PyQt6, specifically tailored for displaying and manipulating real-time video streams and user-configurable settings.
Applying Custom Visual Post-Processing: Explored and implemented various custom visual effects and overlays (glitch, scanlines, chromatic aberration) to transform a raw video feed into a stylized, themed output.
Nuances of Face Recognition Systems: Understood the practical aspects of setting up, training, and fine-tuning face recognition systems for specific identity management, including data preparation and tolerance adjustments.
This project is classified as Advanced due to its integration of multiple cutting-edge AI technologies (real-time face recognition and instance segmentation), the necessity for significant performance optimization (caching, multi-threading) to handle these models in real-time, and the development of a complex, interactive GUI with custom visual effects. It goes beyond typical "beginner" or "intermediate" projects by combining advanced computer vision with robust application development and aesthetic considerations.
Keep exploring
Next project
Indie Chess →