Exporting/importing photos in full 32-bit representation (to train a neural network for image denoising)

I think this model delivers more details :slight_smile:

https://drive.google.com/drive/folders/1P0UsenafuSKOmOzUXqRg20-Q6j2eoTXe?usp=sharing

Use it with
python denoise_image.py --arch UtNet --model_path generator_650.pt --input <yourimage.ext> --output <destination.tif>

I trained it 1% of the time using clean-clean images from Wikimedia Commons Featured pictures with ISO <= 200.

If you are using demosaiced images for training, the demosaicing algorithm will affect noise quality/character. EG some algorithms increase noise more than others.

I also suspect that the demosaicing differences between x-trans sensors and bayer sensors will affect performance.

I’ve made two sets of raw images at various ISOs. It’s the same still-life scene under different lighting conditions.

https://drive.google.com/drive/folders/1dBijDabZKb-g4fJAx9ig1zE1Dv2ieHj8?usp=sharing

Unfortunately they are from the ‘vintage’ Nikon D40 which is noisy even at base ISO 200. I have taken 4 shots at ISO 200 so they can be stacked to get equivalent to ISO 50 (I think).

Images are placed into the public domain.

I can make more sets of still life scenes if you want.

1 Like

Indeed more details but it failed to denoise underneath the bird. I tried a couple of other pictures and no issues.
_MG_09902

09902 - latest one - python denoise_image.py --input in/*.tif --output out/*.tif --model_path ../../models/4/generator_650.pt --arch UtNet -i in/${i} -o out/$i

09901 - the last one before - python denoise_image.py --input in/*.tif --output out/*.tif --model_path ../../models/4/generator_734.pt --network UNet --cs 660 --ucs 470 -i in/${i} -o out/$i

0990 - source file
https://drive.google.com/file/d/1tzykH7f90l7yZ1ROvLdnXi_gzW-esS8J/view?usp=sharing

ISO 12800 with Canon EOS M5.





CC0 IMG_6990.CR2 (43.0 MB)

Meanwhile I have been trying to work with PGM files to be able to noise reduce before demosaicing and before black level. Got stuck with PGM files from 7D. When I try to create DNG files from PGM I get the wrong colour. Perhaps wrong cfa pattern? Works with M5, M6, R etc…

Skärmbild från 2021-06-27 14-37-25

For my M5, there were no issue.
dcraw -4 -E -j -t 0 IMG_6990.CR2
IMG_6990.zip (38.2 MB)

./pgm2dng IMG_6990.pgm

IMG_6990.DNG (48.7 MB)
CR2 to the left, DNG from pgm2dng to the right.
After that I copied all metadata with
exiftool -tagsFromFile IMG_6990.CR2 -all -icc_profile IMG_6990.DNG

pgm2dng is avalible from Magic Lantern http://a1ex.magiclantern.fm/bleeding-edge/pgm2dng.c
Compile it with gcc -o pgm2dng -m32 pgm2dng.c /path/to/magic-lantern/src/chdk-dng.c -I/path/to/magic-lantern/src -lm

Or use the one I compiled for M5.
pgm2dng.zip (8.9 KB)

Thank you @Iain ! I will try to incorporate these in the dataset asap. The base ISO looks quite good.

@Peter The model indeed performs very poorly on this bird :confused: Hopefully something that is fixed by training from unprocessed images.

But works great with the next bird ^^

Could you please try to train these PGM files? Just one set, but that is what I have from M5 right now and this is only for testing. https://drive.google.com/file/d/1Q9XV7XiszRZ43ur_LesTJeJDPeA853O5/view?usp=sharing

After that, try to noise reduce IMG_6990.pgm in the post above.

Will do, It might take me a while (a month or so?) because I’m currently focusing a lot on File:ElectricBoatDiagram.png - Wikimedia Commons and I will hopefully be moving soon. I’m excited to start working on raw/ish denoising though. Thank you for working on this :slight_smile:

1 Like

Meanwhile I will take some new sample series.

Got 7D to work with pgm2dng. Checked rawspeed/cameras.xml at develop · darktable-org/rawspeed · GitHub and cfa order for 7D. Used 0x01000201 for 7D.
Skärmbild från 2021-07-03 16-14-45

Skärmbild från 2021-07-03 16-14-16

2 Likes