How paco1127/pure-blur works
Main Components Identification
• User Interface & Client Side:
– A web UI built with HTML templates (in the “templates” folder) and static assets (in “static”) that provides pages (login, register, upload, report, etc.).
– A browser extension (“FYP_extension/Pure Blur Extension”) that integrates with Chrome to offer in-browser blurring of sensitive content.
• Backend / API Server:
– The central application entry-point (app.py in the project root and within the Face folder) that handles requests from the web UI.
– This layer coordinates file uploads (stored in “uploads”), user management (from CSV files like “users.csv” and “userFiles.csv”), and response rendering (templates).
• Media Processing Modules:
– Face Module: Contains several submodules (detection, alignment, recognition, and tracking) with multiple implementations (RetinaFace, SCRFD, YOLOv5 Face, and ArcFace). Each component is likely used in face detection, enrollment (add_persons.py), alignment, recognition, and tracking (tracker modules with Kalman filter, byte tracker, etc.).
– Blood Module: Incorporates a PyTorch model (blood.pt) and supporting scripts (blood.py, blood_class.py) that likely detect blood-related patterns in imagery.
– Foul Module: Handles censorship of potentially offensive content (like mute.py and CSV-based data such as DirtyWords.csv) used in processing audio content.
– Nude Module: Contains ONNX based detection (best.onnx) and associated detectors (nude_detector.py, video_detector.py) used to screen for explicit content.
– Video Module: Contains utilities such as video_converter.py to process incoming video files.
• Data Storage & Persistence:
– File system based storage for uploads (organized in “uploads” folders – original, censored, etc.).
– CSV files (e.g., users.csv, userFiles.csv, report.csv) used as lightweight databases for user information and file associations.
• External Dependencies & Tools:
– System dependencies such as Python 3.11, FFmpeg (installed via Scoop), and Git.
– Machine learning frameworks (PyTorch, ONNX Runtime) and supporting libraries for executing detection models.
Relationships & Interactions
• User interaction via the web interface (UI) triggers file uploads and account operations.
• The backend server’s API receives these requests and dispatches the files for processing:
– Uploaded content is sent to appropriate detection modules (face, blood, foul, nude) depending on the media type.
– Each processing component (running its own algorithms/models) analyzes the content and returns status or processed outputs.
– Results are stored in “uploads/censored” or similar directories and entry points (CSV logs) are updated.
• The Chrome extension functions as an independent client that taps into similar processing or presentation logic for real-time blurring.
Architectural Patterns and Design Principles
• Modular design: Each detection module is cleanly separated (Face, Blood, Foul, Nude, Video) and can be represented as individual services or library components.
• Separation of concerns: The UI layer (HTML/JS) is separated from the backend logic where business rules and processing occur.
• Integration of third-party libraries and ML models: Clearly indicate external ML frameworks (like ONNX models, PyTorch) and how they feed into the processing.