How li-chongyi/zero-dce_extension works
Project Type and Purpose
• This project is a computer vision deep learning application focused on enhancing low-light images using the Zero-DCE++ network.
• It uses PyTorch as the primary deep learning framework along with supporting libraries (e.g., OpenCV for image processing).
File Structure
• Top-level files and folders include:
• README.md for overall project description and usage.
• Two main Python scripts: lowlight_test.py (for testing/enhancement) and lowlight_train.py (for training the model).
• The “Zero-DCE++” folder that includes key modules:
• model.py – holds the network architecture for image enhancement.
• dataloader.py – handles loading and processing of the training and test image data.
• Myloss.py – likely contains custom loss functions for training.
• The “data” folder is divided into train and test datasets.
• “snapshots_Zero_DCE++” folder holds pre-trained model weights (e.g., Epoch99.pth).
Key Components
a. Data Sources:
• Train Data and Test Data folders located under “data”.
• (When testing) a “result” folder is generated to store enhanced images.
b. Data Loader:
• The dataloader.py module that reads images from the file system.
c. Model (Zero-DCE++ Network):
• model.py which encapsulates the deep learning network for low-light enhancement.
• Myloss.py (if used during training) to calculate the training error.
d. Training Pipeline:
• lowlight_train.py reads training data via the dataloader, passes it through model.py, applies losses (Myloss.py), and, subsequently, updates model parameters.
• The training process saves snapshots (model weights) in the “snapshots_Zero_DCE++” folder.
e. Testing Pipeline:
• lowlight_test.py loads the pre-trained model (Epoch99.pth) from snapshots, processes images from “data/test_data”, enhances them, and writes the outputs into a new “result” folder inside the “data” folder.
f. External Dependencies:
• PyTorch for deep learning operations.
• torchvision (supporting image transformations).
• OpenCV for image input/output processing.
• CUDA for acceleration if available.
• A “Data Module” representing input images, divided into “Train Data” and “Test Data”.
• A “Data Loader” block (from dataloader.py) that fetches and pre-processes images.
• A “Model Module” block representing the Zero-DCE++ network (model.py) along with the “Loss Component” (Myloss.py).
• A “Testing/Inference Pipeline” block encompassing lowlight_test.py, which loads pre-trained weights and processes test images.
• Rectangles for core processing modules (Data Loader, Model, Training Pipeline).
d. Clearly label every component with its associated file or function:
• Also clearly show “lowlight_train.py” and “lowlight_test.py” as entry points for training and inference respectively.