Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

New free open source AI denoise framework and GUI tool - AstroDenoisePy

  • Please log in to reply
91 replies to this topic

#26 jonnybravo0311

jonnybravo0311

    Aurora

  • *****
  • Moderators
  • Posts: 4,998
  • Joined: 05 Nov 2020
  • Loc: NJ, US

Posted 12 November 2022 - 12:15 PM

Ben,

 

I'm having a bit of trouble with the above - stuck partway.  

 

The above git clone command assumes that you have gone through the steps to set up an account on git.  I don't have one, so it fails.  

 

attachicon.gifScreenshot at 2022-11-11 21-12-33.png

 

I did look look up the (publickey) error, and the suggested remedies all seemed to be in the context of maybe-this-or-maybe-that, for developers who wished to check in.  I just want to download this and try it - I doubt I'd ever have a reason to check in.

 

I WAS able to find an https: solution that got me through the clone without the account setup, but I'm stuck at the next step, the "checkout linux-fixes" line.   No idea how to deal with that.  

 

attachicon.gifScreenshot at 2022-11-11 21-59-33.png

 

Can you help?

 

Thanks!

Once you've cloned the repo, go into the directory that was just created. In your case, it looks like you cloned the repo into ~/Downloads/Denoise. So, first, you'd do this:

cd ~/Downloads/Denoise/astro-csbdeep

You can list the available branches by running the command

git branch -a

That would return something like this:

* astro
  remotes/origin/HEAD -> origin/astro
  remotes/origin/astro
  remotes/origin/linux_fixes

Everything with "origin" are remote. So, you've got "astro" locally (that's the default branch and was what you cloned). Now you can run the checkout command. Personally, I'd use the "switch" command instead as its intent is a bit clearer:

git switch linux_fixes

Do that and you'll see this:

Branch 'linux_fixes' set up to track remote branch 'linux_fixes' from 'origin'.
Switched to a new branch 'linux_fixes'

Now when you do the git branch -a command again:

git branch -a
  astro
* linux_fixes
  remotes/origin/HEAD -> origin/astro
  remotes/origin/astro
  remotes/origin/linux_fixes

As you can see you've got a local copy of the linux_fixes branch, and it is your current working branch (that's the asterisk next to it).



#27 Devonshire

Devonshire

    Viking 1

  • *****
  • Posts: 708
  • Joined: 10 Mar 2017
  • Loc: S/W Ontario, Canada

Posted 12 November 2022 - 11:02 PM

Thanks, JohnnyBravo!

 

That worked.  I had not twigged on the purpose of venv, until I watched it run. Then the light went on :-))

 

It happily pulled down a small boatload of packages to a subdirectory.  Quite a list! 

 

It was not happy about my CUDA version, but nothing to be done about that.  My graphics card is too old, and my NVIDIA driver is already at the max version for the card, so I can't get up to CUDA 11.x.  But it didn't really matter, as despite the complaints, the load just shifted over to the CPU, which is upgraded.  Just took a few minutes per image. 

 

I've tried it on a finished, RGB .tiff, and on a mono OIII .fits stack. Both showed real improvement.  Very nice.  However, there was something wrong with the OIII .fits file, and APP threw a java error while trying to render it.  I still had the image in the tool, saved it again as a .tiff, and APP was able to render that ok. 

 

It's a bit of a diamond-in-the-rough.   The installation on Mint 20.x was cranky and needed a bit of additional fiddling that I haven't described.  The UI could use some ToolTips, the save dialog needs smoothing out, and then there's that .fits problem.

 

BUT...while I haven't gone through the whole post-processing cycle, this thing made a real improvement in the two cases I tested. I will reprocess my recent IC1805 post with this and see what I end up with.  The capability looks very useful so far - it just needs a developer to give it a little love re: usability, for us muggles.  :-) 

 

Once again... Thanks for your help, JohhnyB.  Good instructions.


Edited by Devonshire, 13 November 2022 - 10:06 AM.


#28 Devonshire

Devonshire

    Viking 1

  • *****
  • Posts: 708
  • Joined: 10 Mar 2017
  • Loc: S/W Ontario, Canada

Posted 13 November 2022 - 07:24 PM

I've spent the day bumping around with this. 

 

My source data are stacks of Ha/OIII/SII monos, as well as a color composite I'd posted earlier, on another thread.  The effect on the monos can be pretty dramatic, and the denoise strength needed varied with the quality of the stack.  The Ha's had strong signal, and were helped with only a few percent of "denoise strength".  The weaker OIII and SII needed more.  Too much, and you get a "waxy" appearance, so trial-and-error needed.

 

When I brought them back into APP's RBG Combine, though, I was seeing colored pixels just slightly offset in places.  Slight multicoloration on diffraction spikes, etc.  Not dramatic, but not what I wanted.  I put the monos aside, with regret.  Maybe try again some time.

 

Next stop was to try this on an RGB color composite of my monos.  The composite I'd posted elsewhere (link below) did not have as much color as I'd have liked, so I took another run at (APP) RGB Combine, created an image with more color, and ran that through Denoise py at 50% denoise strength and Tiles at 4. 

 

The effect was subtle, but worthwhile (closeup below).  Overall, I think it helps with contrast.  Left is the new composite, right is the new composite after Denoise.  Probably needs more fooling around, but for now, I'll take it.  :-)

 

Compare.JPG

 

 

Post with larger image:

 

https://www.cloudyni...reme-sii-combo/

 

 


  • galacticinsomnia likes this

#29 benula

benula

    Vostok 1

  • *****
  • Posts: 165
  • Joined: 27 Apr 2011
  • Loc: Stillwater, MN

Posted 14 November 2022 - 09:21 AM

Sorry, I wasn't getting notifications about this thread so didn't see them until i stumbled over it while browsing. I'm glad you got it working. I agree that the trick is finding the right strength value where it removes the noise without making the image look too baked.

I have the same issue with my nvidia card being too old for the CUDA support that the software needs. Can anyone with a newer GPU comment on how long it takes to process using the GPU? If it's a second or two, then I would be tempted to pick up a modern, cheaper card since it would make finding the right strength much easier.



#30 Tapio

Tapio

    Voyager 1

  • -----
  • Posts: 11,082
  • Joined: 24 Sep 2006
  • Loc: Tampere, Finland

Posted 14 November 2022 - 11:05 AM

Now it takes me about a minute to process (asi533mc) image.
I have now GeForce GTX 980 card and the software now complaints now of CUDA.
Do I have now new enough card and if so how can I utilize it?

#31 Devonshire

Devonshire

    Viking 1

  • *****
  • Posts: 708
  • Joined: 10 Mar 2017
  • Loc: S/W Ontario, Canada

Posted 14 November 2022 - 01:11 PM

Now it takes me about a minute to process (asi533mc) image.
I have now GeForce GTX 980 card and the software now complaints now of CUDA.
Do I have now new enough card and if so how can I utilize it?

The utility is looking for CUDA v11-point-something, so not just CUDA support, CUDA support at a given version. 

Get your specific 980 card model (desktop or mobile?), then figure out what Nvidia driver version you have. 

Then figure out if that specific driver version will support CUDA v11.x. 

If not, what upgrade is available, and will THAT driver support CUDA v11.x? 

Once you have installed an NVIDIA driver that will support v11 (and works on your machine...), then go looking for CUDA. 

On linux, it was straightforward for me to figure out my card (ancient), and driver version (turned out to be the terminal version for my card). 

Then a bunch of googling around the Nvidia site to figure out that I was out of luck as far as CUDA v11 was concerned.  bawling.gif  


Edited by Devonshire, 14 November 2022 - 01:12 PM.


#32 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 14 November 2022 - 09:03 PM

According to NVidia, if I’m reading everything correctly, aIl 960 and newer cards have a driver that should support CUDA 11.8. I have a 980ti and am planning to try this awesome looking app. If I get it working this weekend, I will report back. It is a moonless weekend so if the weather clears I may be imaging so it might be a bit longer. 



#33 rcol

rcol

    Vostok 1

  • *****
  • Posts: 160
  • Joined: 11 Mar 2020
  • Loc: Laguna Woods, CA

Posted 14 November 2022 - 10:52 PM

IS THE DOWNLOAd link gone?



#34 Tapio

Tapio

    Voyager 1

  • -----
  • Posts: 11,082
  • Joined: 24 Sep 2006
  • Loc: Tampere, Finland

Posted 15 November 2022 - 07:31 AM

jml79 - have you tried and how did it go ?

 

I tried it too

- installed newest driver 526.86-desktop-win10-win11-64bit

- installed cuda_11.8.0_522.06_windows

This didn't help so I tried to install tensorflow components

https://www.tensorflow.org/install/pip

This installled some more but in the end I get these:

"tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found"

I have installed Anaconda instead of python so that could be something to do.

 

I tried this trick (copy cudnn64_8.dll to cuda directory):
https://stackoverflo...8-dll-not-found

But it only made program crash when it started denoising.


Edited by Tapio, 15 November 2022 - 07:49 AM.


#35 Devonshire

Devonshire

    Viking 1

  • *****
  • Posts: 708
  • Joined: 10 Mar 2017
  • Loc: S/W Ontario, Canada

Posted 15 November 2022 - 10:29 AM

Do watch the java console box for complaints, while stabilizing the tool.. 

 

On mine, there was an ini or config file that wasn't in the expected place and needed to be copied.  I was also missing a "cutbuffer provider" (linux), and had to install xsel and xclip to sort that out.   FWIW... no idea about how this maps to Windows issues.  But again - watch the console box and see what it complains about.


Edited by Devonshire, 15 November 2022 - 10:40 AM.


#36 Tapio

Tapio

    Voyager 1

  • -----
  • Posts: 11,082
  • Joined: 24 Sep 2006
  • Loc: Tampere, Finland

Posted 15 November 2022 - 10:49 AM

Do watch the java console box for complaints, while stabilizing the tool.. 

 

On mine, there was an ini or config file that wasn't in the expected place and needed to be copied.  I was also missing a "cutbuffer provider" (linux), and had to install xsel and xclip to sort that out.   FWIW... no idea about how this maps to Windows issues.  But again - watch the console box and see what it complains about.

Yes I saw some complaints, but there was only second or two to see that console before it shut down...



#37 Devonshire

Devonshire

    Viking 1

  • *****
  • Posts: 708
  • Joined: 10 Mar 2017
  • Loc: S/W Ontario, Canada

Posted 15 November 2022 - 11:43 AM

Yes I saw some complaints, but there was only second or two to see that console before it shut down...

Arggh...  This is Windows?  On Mint, the console stayed up and I could scroll the contents.  Took me 2 or three tries to get past the bumps.

 

It's been a while, but I think there are some things you can do in Windows to get a command window (console) to hang around.  You could have a look at the link below and see if any of it helps you.   

 

https://superuser.co...fter-execution 


Edited by Devonshire, 15 November 2022 - 11:44 AM.


#38 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 20 November 2022 - 04:18 PM

Alright, diving into this on a blizzardy Sunday afternoon while the kids are napping. I have a feeling this project is going to take me a day or two. First of all, AMAZING. I downloaded the MSI install from this link;

 

https://github.com/p...sbdeep/releases

 

and installed and ran. Within a few minutes I had it working and produced some results. It takes me about 1m 05s to run a denoise on my 12700K (20 cores) w/64gb ram. The results are staggering. I am now going to have to go back and reprocess my best images. Here is a look at a noisy, under integrated image I took for this months challenge. 3h 18m at f/4.5 using a 76EDPH and a 36mp A7R with an IDAS NBZ 12nm dual band filter. Left third is non noise reduction, centre third is my normal (and very ineffective) noise reduction and the right third is AstroDenoise at default setting, normalize turned off.

 

Main Edit V2 Denoise Sample Forum.jpg

 

I'll post the whole image run through AstroDenoise so you can see there is little to no loss of the details I care about. I just installed LSW so I can install tensorflow but there are a few things to install after that to get CUDA going. If I get it working and it's faster, I'll post a quick guide plus results. So far I am very impressed and even if I never get CUDA working, thanks p7ayfu77 for this awesome program.



#39 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 20 November 2022 - 04:20 PM

Here is the whole image run through AstroDenoise for comparison and verification of how great a job it does with the background. No more blotchy messes.

 

Main Edit V2 Denoise Sample 2 Forum.jpg


  • Devonshire likes this

#40 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 20 November 2022 - 11:41 PM

jml79 - have you tried and how did it go ?

 

I tried it too

- installed newest driver 526.86-desktop-win10-win11-64bit

- installed cuda_11.8.0_522.06_windows

This didn't help so I tried to install tensorflow components

https://www.tensorflow.org/install/pip

This installled some more but in the end I get these:

"tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found"

I have installed Anaconda instead of python so that could be something to do.

 

I tried this trick (copy cudnn64_8.dll to cuda directory):
https://stackoverflo...8-dll-not-found

But it only made program crash when it started denoising.

OK, so far I have this. CUDAToolKit is required and clears an error "missing cudart64_110.dll", the official version of the cudn64_8.dll is part of the cuDNN SDK package from the nvidia developers network (must create a free account to join). It's a bunch of files that have to be manually copied into the linux file structure inside the CUDATooKit install (/lib, /include, and /bin). I've installed the latest versions of these and experience the same crash as you do when using the GPU. NVidia claims that all CUDA v11 versions are backwards compatible but the TensorFlow website specifies CUDA v11.2 and the matching cuDNN SDK. I'm going to try this tomorrow. The developers notes on github don't specify which CUDA version the windows EXE was compiled against but I did notice some references to Python 2.7 which may mean he compiled against a CUDA 10 version in which case we will need to determine the exact version match to get GPU working.

 

The program still works perfectly well if you select CPU instead of GPU or if you don't setup CUDAToolKit with the cuDNN SDK. It will just tell you something is missing and revert to CPU mode.

 

I really hope my 2015 GPU is faster than my 2021 processor after all of this.


Edited by jml79, 20 November 2022 - 11:44 PM.


#41 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 21 November 2022 - 12:42 AM

So much for tomorrow night. I got it working and on my 980ti, a denoise without normalize of a starless (starnet++)16bit tif of 36MP takes less than 18 seconds. This is over 3x faster than using an Intel I7-12700K, a 20 core processor from 2021. My 6gb card was able to process a 144MP drizzled image but not without complaining about lack of memory and having to resort to a fallback method of some sort. My task manager also reported a pretty severe shared memory usage of 31.9GB but I have no idea if that's needed or if CUDA is using it because it's there.

 

Here's what I needed.

I had to install CUDAToolKit 11.2.0 from this link; https://developer.nv...toolkit-archive

 

Install the CUDA toolkit but select the custom install and deselect all options except the toolkit. If you miss this step the toolkit will downgrade your video driver. This works with the latest 526.98 driver so no need to downgrade it to an older one. It will also warn you about not having MS Visual Studio, select continue anyway.

 

Next I had to join the NVidia developers network and download cuDNN 8.1.0.77 from here; https://developer.nv...p/cudnn-archive

 

Copy the contents of the cuDNN zip to the CUDAToolkit folder C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2 It will add the contents of the 3 folders into the existing folders.

 

Restart AstroDenoisePY

 

As a side bonus, I have confirmed that Starnet++ V2 GUI will run with CUDA 11.2 following only the very first bit of the instructions at this link; https://www.williaml...om/starnet-cuda and simply replacing the tensorflow.dll in the StarNetV2GUI_Win folder with the one here; https://storage.goog...86_64-2.7.0.zip and no other steps. Using the same test image the compute time went from 1m20s on my pretty fast processor to 26 seconds on my pretty old video card. Happy days.


Edited by jml79, 21 November 2022 - 12:51 AM.


#42 Tapio

Tapio

    Voyager 1

  • -----
  • Posts: 11,082
  • Joined: 24 Sep 2006
  • Loc: Tampere, Finland

Posted 21 November 2022 - 03:12 AM

Wov jml79, I'm ever grateful to you.

Did all you instructed and the time for my test image, 9mpix ASI533MC, went from 1 minute to 3 seconds shocked.gif

Any reason not downloading newer cuDNN like 8.5.0 which is for CUDA 11.x ?



#43 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 21 November 2022 - 06:54 AM

I went with the versions listed as compatible with the official tensorflow website. I have no idea what breaks tensorflow in newer versions but you would have to try each upgrade to find out which one breaks it. I only have so much time so working is what I’m good with. I only have the two listed apps that use CUDA.

 

What is your computer specs?


Edited by jml79, 21 November 2022 - 06:54 AM.


#44 Tapio

Tapio

    Voyager 1

  • -----
  • Posts: 11,082
  • Joined: 24 Sep 2006
  • Loc: Tampere, Finland

Posted 21 November 2022 - 07:01 AM

No complaints, I'm happy now it's working faster.

 

I have now i3-4150 CPU @ 3.5Ghz and GeForce GTX 980, 16GB main memory.



#45 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 21 November 2022 - 09:19 AM

Oh boy, you need to get Starnet working in CUDA too then. That is not a fast processor. Leverage that video card for everything it’s worth. 



#46 Sky King

Sky King

    Vanguard

  • *****
  • Posts: 2,495
  • Joined: 16 Mar 2017
  • Loc: Arizona

Posted 25 November 2022 - 06:43 PM

Thanks!! I installed AstrodenoisePy, and loaded a image and hit the denoise check box, then the Process button after the first step was done and got a greatly improved image!

Am I doing it right? Also no Cuda or tensorflow were loaded. A few simple directions somewhere would help. Pressing the "eye" buttom to switch to the former screen was good. Maybe mine should be set on CPU rather than GPU? Image from Deep Sky stacker, before and after.

 

 

IC443-original.jpg

 

 

 

ic443-processed.jpg

 



#47 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 25 November 2022 - 08:05 PM

Thanks!! I installed AstrodenoisePy, and loaded a image and hit the denoise check box, then the Process button after the first step was done and got a greatly improved image!

Am I doing it right? Also no Cuda or tensorflow were loaded. A few simple directions somewhere would help. Pressing the "eye" buttom to switch to the former screen was good. Maybe mine should be set on CPU rather than GPU? Image from Deep Sky stacker, before and after.

 

 

attachicon.gifIC443-original.jpg

 

 

 

attachicon.gific443-processed.jpg

If you don’t have an NVidia 9xx or higher and the correct drivers it will automatically default to CPU without changing anything. If you have the wrong CUDA drivers it will just crash. If you have the right hardware, follow my post earlier and both AstroDenoisePY and StarNet V2 will run many times faster. I have possibly an extreme example, my new 20 thread processor is beaten by about 4x by my 8 year old video card. Tapio with his 4 thread processor likely saves about 5 minutes by enabling CUDA. 


  • Sky King likes this

#48 Sky King

Sky King

    Vanguard

  • *****
  • Posts: 2,495
  • Joined: 16 Mar 2017
  • Loc: Arizona

Posted 25 November 2022 - 08:42 PM

If you don’t have an NVidia 9xx or higher and the correct drivers it will automatically default to CPU without changing anything. If you have the wrong CUDA drivers it will just crash. If you have the right hardware, follow my post earlier and both AstroDenoisePY and StarNet V2 will run many times faster. I have possibly an extreme example, my new 20 thread processor is beaten by about 4x by my 8 year old video card. Tapio with his 4 thread processor likely saves about 5 minutes by enabling CUDA. 

Thanks for the reply. I'm running a older desktop: Intel® Core™ i7-2600 CPU @ 3.40GHz, 8GB RAM, Radeon HD 5570. It apparently still works even though it take a couple minutes which is no problem. The results are nice.



#49 dciobota

dciobota

    Soyuz

  • *****
  • Posts: 3,735
  • Joined: 07 Aug 2007
  • Loc: No longer on this site in protest of poor site moderation

Posted 21 December 2022 - 11:04 AM

So, after playing with this some more, I notice on some of the images it darkens the background way too much and clips some faint detail.  These are stretched images btw.  I unchecked the normalize function to prevent any further stretching.  I also tried both models, the default and the other one, with the same effect.  Is there any way to disable this darkening?

 

Thanks again for this tool.



#50 jml79

jml79

    Surveyor 1

  • *****
  • Posts: 1,781
  • Joined: 10 May 2022
  • Loc: Belleville, Ont, Canada

Posted 25 December 2022 - 08:27 PM

So, after playing with this some more, I notice on some of the images it darkens the background way too much and clips some faint detail.  These are stretched images btw.  I unchecked the normalize function to prevent any further stretching.  I also tried both models, the default and the other one, with the same effect.  Is there any way to disable this darkening?

 

Thanks again for this tool.

I find denoise settings of 0.700 and lower do not darken the background. I have also found that the alternate model and a setting lower than 0.300 is enough on low noise long intégrations. The default model and 0.900 will denoise a seriously rough image but with some loss of detail that has to be recovered later. I have also found blending 2 different denoised images to help using a luminosity mask in an image processing program. This lets me really clean up the shadows but retain more detail in the brighter parts of the image. 


  • dciobota likes this


CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics