Show me how you denoise

Ah ok, I didn’t know that, now I’ll edit!

Nice catch, I respected the framing.

1 Like

Just thought it’s interesting how the neural-network would interpret the feather texture. Sigmoid and exposure in darktable, then fed through nind-denoise (with the new model _257 from daniezest, not sure which dataset it was trained from), and GMIC’s richarsonlucy_deblur (10 iterations).

7 Likes

This actually looks very nice!

A lot of the detail looks wonderful, but there is a big splotch on the wing that just looks fuzzed out. Overall, this is one of the best, but that part messes it up.

And that branch looks like it’s made from plastic!

Yeah, this is a hard problem. The model is trained from pairs of clean-noisy images. It’s easy to bracket static objects, but animals, especially birds, are tricky. It also doesn’t work well with human skins/face as the dataset doesn’t have any human subject.

I’m still trying to shoot more sample data for training, hopefully the community can contribute. It’s a promising tool, especially when most commercial tools is moving toward AI/neural-network for NR.

The previous post from the author:

3 Likes

My try with Rawtherapee 5.9


151A2902-1.jpg.out.pp3 (14.4 KB)

2 Likes


Also a comparisson left is RT 5.9 with my tinkering and right Topaz Photo AI (automatic mode)

3 Likes

Wow so I just got a new display plus colorimeter. I have done a few renditions to create display profiles… I used the basic software provided and displaycal…so many options and a lot more testing required yet before I settle on the right combination. I have tried a few matrix and lut profile options. One thing I noticed right away is that my monitor which is a run of the mill Acer 30 inch with a max brightness of I think 300cd/m needed to be dropped to 43 % brightness to meet the calibration standard of 120 and some people go as low as 80. Making these profiles I hit a few different options and I am still debating whether to use ambient light and a few other tweaks that can be used…the bottom line is that now about half the images here I am sure are much brighter on the monitor of the poster. My brightness was around 80 before I profiled the monitor and I know many people often have it cranked right up… So the thing I wonder now is will my exports look too bright to many people with sort of out of the box settings and will many of the images from others be extremely dark…
Maybe after a bit more experimentation I will have a different impression but the luminance part of this process is pretty strait forward…

2 Likes

Does topaz get better if you use non-auto mode? The results are a bit underwhelming and your RT fiddling looks pretty decent.

2 Likes

That was my first impression also. So I tested it again with topaz (automatic) and got better results, don’t know wha

1 Like

How does it work? After pip3 install --user torch torchvision ConfigArgParse opencv-python pyyaml piqa I’ve unziped nind-denoise from gith and from nind-denoise-master/src/nind_denoise I tried this:

$ python3 denoise_image.py --network UNet --model_path "../../models/model1" -input ~/Immagini/sequatorandromeda.tif [-o ~/Immagini/andromedadenoised.tif]
cs and/or ucs not set, using defaults ...
cs=440, ucs=320
find_best did not find ../../models/model1/trainres.json
Traceback (most recent call last):
  File "/home/fabio/Programmi/nind-denoise-master/src/nind_denoise/denoise_image.py", line 224, in <module>
    model = Model.instantiate_model(network=args.g_network, model_path=args.model_path,
  File "/home/fabio/Programmi/nind-denoise-master/src/nind_denoise/nn_common.py", line 127, in instantiate_model
    path = Model.complete_path(path=model_path, keyword=keyword, models_dpath=models_dpath)
  File "/home/fabio/Programmi/nind-denoise-master/src/nind_denoise/nn_common.py", line 110, in complete_path
    return os.path.join(path, find_highest(os.listdir(path), keyword))
  File "/usr/lib/python3.10/posixpath.py", line 90, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.10/genericpath.py", line 152, in _check_arg_types
    raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'NoneType'

Where am I wrong?

The square bracket in documentation indicates that it’s optional (if you don’t include -o option, it’ll output into its default location and filename). Don’t use the square brackets in the actual command. However, the error message looks like it couldn’t find the model file (usually *.pt or *.pth). Assuming there is a “model_257.pth” file inside the model1 directory, the command should be like this:

python3 denoise_image.py --network UNet --model_path "../../models/model1/model_257.pth" --input ~/Immagini/sequatorandromeda.tif --output ~/Immagini/andromedadenoised.tif

or using absolute path to be on the safe side:

python3 denoise_image.py --network UNet --model_path "/home/fabio/Programmi/nind-denoise-master/models/model1/model_257.pth" --input ~/Immagini/sequatorandromeda.tif --output ~/Immagini/andromedadenoised.tif
1 Like

In the meantime, thank you very much, now the command seems to be correct, but there are still some problems that I don’t know how to interpret:

$ python3 denoise_image.py --network UNet --model_path "/home/fabio/Programmi/nind-denoise-master/models/model1/model_257.pth" --input ~/Immagini/sequatorandromeda.tif --output ~/Immagini/andromedadenoised.tif
cs and/or ucs not set, using defaults ...
cs=440, ucs=320
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'nnModules.UNet' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'torch.nn.modules.container.Sequential' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'torch.nn.modules.activation.ReLU' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'torch.nn.modules.pooling.MaxPool2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
/home/fabio/.local/lib/python3.10/site-packages/torch/serialization.py:888: SourceChangeWarning: source code of class 'torch.nn.modules.conv.ConvTranspose2d' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
  File "/home/fabio/Programmi/nind-denoise-master/src/nind_denoise/denoise_image.py", line 229, in <module>
    ds = OneImageDS(args.image, args.cs, args.ucs, args.overlap, whole_image=args.whole_image, pad=args.pad)
  File "/home/fabio/Programmi/nind-denoise-master/src/nind_denoise/denoise_image.py", line 84, in __init__
    self.inimg = np_imgops.img_path_to_np_flt(inimg_fpath)
  File "/home/fabio/Programmi/nind-denoise-master/src/common/libs/np_imgops.py", line 17, in img_path_to_np_flt
    raise FileNotFoundError(fpath)
FileNotFoundError: in.jpg

:roll_eyes: I wonder if that tell anything to anyone… :grimacing:


A test for gimp3mlt: rawtherapee (demosai with IGV)->gimp3ml-denoise->gimp2.10-gmic Iain denoise.
I would say nind-denoise is better.

You can safely ignore those SourceChangeWarning, the model was built using a different version from the current library but it’d still work fine.

I’m not sure what daniezest has changed in their repo that might have a different syntax for input file (what’s the error is about). I’m using the code from the original repo, so try cloning and running from this repo instead (but copy the model1 folder from daniezest repo over):

1 Like

@sillyxone I wonder if you could shoot some training data of stuffed birds like at a natural history museum or your local university’s biology department or something like that.

@sillyxone I wonder if you could shoot some training data of stuffed birds like at a natural history museum or your local university’s biology department or something like that.

Yeah, good idea, I’ll give it a try. I’ve been playing around with shooting live birds in my yard. I’ve an optimized setup for bracketing on my X-T2 with almost no delay in between shots, but it still takes more than a few seconds for all the shots, and the birds tend to turn their heads around constantly.

I hope I understood correctly, I used this https://github.com/trougnouf/mthesis-denoise with model1 folder from nind-denoise.
And it works! But there is a but, the image is checkered:


:thinking:

I hope I understood correctly, I used this https://github.com/trougnouf/mthesis-denoise with model1 folder from nind-denoise.
And it works! But there is a but, the image is checkered:

Wait, I mentioned the newer light-weight repo from the author: /trougnouf/nind-denoise

How did you end up with the old full-size repo (/trougnouf/mthesis-denoise)? I’ve ran into those grid lines, it’s mostly because the model wasn’t symmetrical but was executed as such (UtNet vs Unet).

Try again with the /trougnouf/nind-denoise repo, paste the command you use here as that will help troubleshooting. I’m currently on my own branch as I’ve added a python script to inject nind-denoise into the export process of darktable. It might be easier for me to help you if we’re on the same code/branch:

2 Likes