Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/Restorer/Cond_NAF.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 2 additions & 0 deletions src/training/RawDatasetDNG_load_into_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading