Views
No views yet
https://github.com/RunyuZhu/Naka-GShttps://huggingface.co/papers/2604.11142https://arxiv.org/abs/2604.11142mul_map and add_map,<image_name>_enhanced.JPG.ChromaGuidedUNet. Its forward pass takes low and naka tensors as input, constructs an 18-channel feature tensor, predicts mul_map and add_map, and performs frequency-decoupled correction on the Naka image.enhancedmul_mapadd_mapbest.pth: the best one during evallatest.pth: latest training state. We usually use this one during inferencelatest.pth every epoch and updates best.pth whenever validation PSNR improves.Phototransduction implementation and tries to import it from either retina.phototransduction or phototransduction. For a standalone release, place phototransduction.py next to naka_color_correction.py, or preserve the original package layout.1.
2├── README.md
3├── requirements.txt
4├── naka_color_correction.py
5├── phototransduction.py
6├── best.pth
7├── latest.pth
8└── assets/
9 ├── *** # optional
10 └── results.png # optional1git clone https://huggingface.co/<your-username-or-org>/<your-model-repo>
2cd <your-model-repo>
3pip install -r requirements.txttorchtorchvisionnumpyopencv-pythonPillowtorchvision.models.vgg19 for the perceptual loss branch during training.naka_color_correction.pyphototransduction.pylatest.pth/best.pth./test_images/1python naka_color_correction.py \
2 --mode infer \
3 --input_dir ./test_images \
4 --output_dir ./outputs/infer_results \
5 --ckpt ./latest.pth1python naka_color_correction.py \
2 --mode infer \
3 --input_dir ./test_images \
4 --output_dir ./outputs/infer_results \
5 --ckpt ./best.pth \
6 --tile_size 512 \
7 --tile_overlap 32--mode, --input_dir, --output_dir, --ckpt, --tile_size, and --tile_overlap for inference.1datasets/
2├── train/
3│ ├── low/
4│ └── normal/
5└── val/
6 ├── low/
7 └── normal/low/ and normal/.1python naka_color_correction.py \
2 --mode train \
3 --data_root ./datasets \
4 --output_dir ./outputs/naka_color_correction_v2 \
5 --epochs 200 \
6 --batch_size 8 \
7 --num_workers 4 \
8 --crop_size 256 \
9 --lr 2e-4 \
10 --weight_decay 1e-4 \
11 --base_ch 32 \
12 --amp1python naka_color_correction.py \
2 --mode train \
3 --data_root ./datasets \
4 --output_dir ./outputs/naka_color_correction_v2 \
5 --resume_ckpt ./outputs/naka_color_correction_v2/checkpoints/latest.pth \
6 --amp1python naka_color_correction.py \
2 --mode train \
3 --data_root ./datasets \
4 --output_dir ./outputs/naka_color_correction_v2 \
5 --init_ckpt ./best.pth \
6 --ampepochs=200, batch_size=8, crop_size=256, lr=2e-4, weight_decay=1e-4, base_ch=32, mul_range=0.6, add_range=0.25, hf_kernel_size=5, and hf_sigma=1.0.NakaCorrectionLoss and NakaCorrectionLossWithMasks.batch_size=1.--amp on CUDA.mul_head weights via adapt_mul_head_to_single_channel().requirements.txt1torch>=2.1.0
2torchvision>=0.16.0
3numpy>=1.24.0
4opencv-python>=4.8.0
5Pillow>=10.0.0