Skip to content

Add support for DnCNN, FDnCNN, and DRUNet - #214

Merged
joeyballentine merged 13 commits into
mainfrom
dpir
Mar 25, 2024
Merged

joeyballentine merged 13 commits into
mainfrom
dpir

Conversation

@RunDevelopment

@RunDevelopment RunDevelopment commented Mar 25, 2024 •

Copy link
Copy Markdown
Member

This implements some of the architectures for DPIR.

One thing to note is that FDnCNN and DRUNet actually take 2 input images, kinda. The idea is that a noise level map is concatenated as another channel to the input image. So a 4-channel input would be RGB + NoiseLevel map. The NL map just defines how much there is at this part of the image, In most cases, the NL map is a constant value, but it doesn't have to be. This NL map constant could also be user-controlled, but I set it to the default value DPIR uses. Both architectures are fairly accepting to "incorrect" NL values, so this shouldn't be an issue.

Lastly, DnCNN and FDnCNN are basically the same arch. The only difference is that DnCNN predicts the noise in an image and subtracts it from the image, while FDnCNN predicts the noise free image. This is why I implemented FDnCNN as a mode inside DnCNN.

I won't implement IRCNN from DPIR. It implements an interesting idea, but it does not perform well and will be a pain to implement. Closes #191

@joeyballentine
joeyballentine merged commit fa9b1ca into main Mar 25, 2024
@joeyballentine
joeyballentine deleted the dpir branch March 25, 2024 18:08
@NevermindNilas

Copy link
Copy Markdown

Interesting, so from the end user side of things. There should be no more hurdles than loading the arch with the provided classes and running model(input_image) assuming that input_image is a torch tensor ( 1,3,1080,1920, for example ).

@RunDevelopment

Copy link
Copy Markdown
Member Author

Interesting, so from the end user side of things. There should be no more hurdles than loading the arch with the provided classes and running model(input_image) assuming that input_image is a torch tensor ( 1,3,1080,1920, for example ).

Assuming that you loaded an RGB model, yes, this will just work. Well, it will after we release a new version :)

@NevermindNilas

Copy link
Copy Markdown

Lovely, can't wait for 0.4 then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DPIR Support.

3 participants