How givoxxs/baby_posture_analysis works
Project Identification
• The project is a full-stack application with a FastAPI-based backend and a lightweight web client. Its purpose is to analyze baby posture through image processing, pose detection (via MediaPipe), posture feature extraction, and risk assessment.
• Key modules include image preprocessing, pose keypoint extraction, posture feature analysis, and risk scoring.
Analyzing the File Structure
• The “app” directory is the heart of the project and contains:
• API endpoints in the “app/api” folder (image.py, pipeline.py, pose.py) that define routes and accept REST API requests.
• A “main.py” that initializes and runs the FastAPI server.
• Service classes in “app/services” (image_service.py, pose_service.py) that encapsulate business logic processing.
• Utility functions and helper modules in “app/utils” that provide image preprocessing, keypoint extraction, and posture feature extraction.
• Static assets (JavaScript and CSS) and HTML templates provide the client interface.
• A configuration file (config.py), logs folder, and requirements.txt support settings, debugging, and dependency management.
Architectural Highlights from the README
• The system is designed as a modular pipeline:
• Image Preprocessing Module (resizing, noise reduction, enhancements)
• Keypoint Extraction Module (MediaPipe usage, 3D landmark detection)
• Posture Feature Construction Module (computing angles, limb positions, etc.)
• Risk Analysis Module (interpretation of posture concerning safety)
• Dependencies include FastAPI for API routing and MediaPipe for pose detection.
• Clear API endpoints (e.g., /api/images/process, /api/pose/detect, /api/pipeline/analyze) indicate how the client interacts with backend processing.