How qsang793/soict-hackathon-2024 works
Main Components
• Docker & Deployment: Include the Dockerfile (in the deployment folder), the shell scripts (deploy.sh, Makefile targets, etc.), and the environment setup (.env) for running the containerized app.
• NAFNet Core Module: This is the deep learning component that handles image restoration and super-resolution. Within this component, note submodules such as:
• Data Modules (basicsr/data): Handles different datasets (FFHQ, REDS, Vimeo90K, etc.) and related utilities.
• Model Architectures (basicsr/models/archs): Contains different architecture implementations (NAFNet_arch, NAFSSR_arch, etc.).
• Losses & Metrics: Subdirectories for losses (losses) and evaluation (metrics like PSNR, NIQE, FID).
• Options/Configuration: Training and testing configuration files (YML files under options) that fine-tune experiments.
• Data Preparation Pipeline (src/src_data): Components like image conversion, deblurring, exposure adjustment, object removal (e.g., remove_motorbike.py), and copy-paste augmentation illustrate the “pre-processing” step for preparing input data.
• Inference Pipeline (src/src_infer): Scripts such as infer_pipeline.py and infer_yolo_light.py indicate the integration of real-time processing (possibly object detection with YOLO via src/utils/yolo_utils.py) on the processed imagery.
• Training Pipeline (src/src_train): Contains scripts for training classifiers, vehicle detection modules, and data-detection (with YAML configurations). This is your “model training” section.
• Auxiliary Components:
• “LoLi_IEA” module: Likely an additional image enhancement or analysis tool (with LoLi_IEA.py and colorSpace.py).
• Utilities: Helpers for YOLO, file management, logging, and more.
• Pre-trained Weights: The “weights” directory holds pre-populated configurations that are loaded by NAFNet.
Their Relationships and Interactions
• Data Flow: Start with raw data and pre-processing in the “src/src_data” module. Prepared data then feeds into the NAFNet training and inference pipelines.
• Model Training and Inference: The training module (src/src_train) uses data and configuration options from the “NAFNet/options/train” to update model parameters in the core NAFNet component. In parallel, the inference module (src/src_infer) uses either newly trained weights (supported by the “weights” folder) or pre-installed models (set up via “python setup.py develop” in NAFNet) to run predictions.
• YOLO Integration: Indicate the connection between YOLO utilities (in src/utils/yolo_utils.py) and the inference module (e.g., via infer_yolo_light.py), which likely provides object detection for surveillance purposes.
• Docker and Deployment: The container houses the entire pipeline; the Docker image is built using the provided deployment scripts and then runs the inference or training processes inside the container environment.
• External Commands and Data Storage: Show that users (or external systems) interact through command-line operations (Makefile, docker run) and that results (e.g., prediction outputs) are stored and can be extracted (docker cp).
Architectural Patterns & Technologies
• Modular Design: The project clearly separates concerns into data preparation, model training/inference, and deployment.
• Configurable Experiments: Use of YAML configuration files under “options” directories suggests that experiments are customizable based on dataset (GoPro, REDS, SIDD, etc.) and model type (NAFNet, NAFSSR).
• Containerization: Docker is leveraged for consistent runtime environments.
• Deep Learning Framework: While not explicit, the setup files (setup.py, pyproject.toml, requirements.txt) likely point to Python-based libraries such as PyTorch or TensorFlow that drive the model implementations.
• Utility & Extensions: The inclusion of scripts for data download, preparation, and even “face_util” or “flow_util” implies additional image processing support.