From 6fabee0bdbef7e871a7e6afd5aba1afd35856e34 Mon Sep 17 00:00:00 2001 From: Ryan Mueller Date: Wed, 5 Nov 2025 13:07:08 -0500 Subject: [PATCH 1/2] Update to noRes model to remove clipping and allow for a dummy residual argument to the forward --- src/Restorer/Cond_NAF.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Restorer/Cond_NAF.py b/src/Restorer/Cond_NAF.py index f710cf6..cfdeaa6 100644 --- a/src/Restorer/Cond_NAF.py +++ b/src/Restorer/Cond_NAF.py @@ -844,22 +844,18 @@ def make_full_model_RGGB(params, model_name=None): class ModelWrapperNoRes(nn.Module): def __init__(self, **kwargs): super().__init__() - - self.gamma = 1 if 'gamma' in kwargs: - self.gamma = kwargs.pop('gamma') + kwargs.pop('gamma') self.demosaicer = DemosaicingFromRGGB() self.model = Restorer( **kwargs ) - def forward(self, rggb, cond): - rggb = rggb.clip(0, 1) ** (1. / self.gamma) + def forward(self, rggb, cond, *args): debayered = self.demosaicer(rggb, cond) - debayered = debayered.clip(0, 1) ** (1. / self.gamma) output = self.model(rggb, cond) - output = (debayered + output).clip(0, 1) ** (self.gamma) + output = (debayered + output) return output From 7fef77cd63a3853bdd9b36d388597a47c1a44927 Mon Sep 17 00:00:00 2001 From: Ryan Mueller Date: Wed, 5 Nov 2025 13:10:58 -0500 Subject: [PATCH 2/2] Local apply alignment import --- src/training/RawDatasetDNG_load_into_memory.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/training/RawDatasetDNG_load_into_memory.py b/src/training/RawDatasetDNG_load_into_memory.py index bafd62f..a1a5f1e 100644 --- a/src/training/RawDatasetDNG_load_into_memory.py +++ b/src/training/RawDatasetDNG_load_into_memory.py @@ -16,6 +16,8 @@ from pathlib import Path from RawHandler.RawHandler import RawHandler +from .align_images import apply_alignment + class RawDatasetDNG(Dataset): def __init__(self, path, csv, colorspace, crop_size=180, buffer=10, validation=False, run_align=False,