How jayanths9/virtual_makeup works
Project Type and Purpose
• This is a single‐process, Python‐based computer vision pipeline (not a web or microservice architecture).
File Structure
• Top‐level scripts:
• camera.py – entry point for live video input
• image.py – entry point for static image processing
• Utilities:
• utils.py – shared functions (landmark filtering, mask creation, blending)
• Configuration:
• environment.yml – Conda environment definition (Python, Mediapipe, OpenCV)
• Sample assets:
• sample/ – test image, landmark reference image, output video
README for Insights
• Confirms pipeline stages: detection → feature extraction → mask creation → blending → output.
• Highlights external dependencies: MediaPipe Face Landmarker, OpenCV.
Main Components and Their Interactions
a. Input Sources
– Static Image Input (image.py)
– Live Camera Stream (camera.py)
b. Face Detection & Landmark Extraction
– MediaPipe Face Landmarker API
c. Feature Extraction
– utils.extract_* functions to select lip, eyebrow, eyeliner, eyeshadow landmark points
d. Mask Generation
e. Blending Engine
– utils.blend_images: merge original frame/image and mask with adjustable alpha weights
f. Output Renderer
– Display on screen (cv2.imshow) or write to file/video (cv2.VideoWriter)
Diagramming Relationships
Input → Face Landmarker → Feature Extraction → Mask Generation → Blending → Output
• Calls from camera.py and image.py into utils.py and into MediaPipe API as external service.
Architectural Patterns & Principles
• Pipeline / staged‐processing pattern
• Separation of concerns: input handlers, processing utilities, external API integration.
• Modularity: utils.py encapsulates reusable image‐processing functions.
Technologies & External Services
• Python 3.x
• Conda environment (environment.yml)
• Google MediaPipe Face Landmarker (external library)
• OpenCV for I/O, drawing, blending