DmitryUlyanov / deep-image-prior

Image restoration with neural networks but without learning.
https://dmitryulyanov.github.io/deep_image_prior
Other
7.9k stars 1.43k forks source link

Restoration on Mac M1 ? #101

Open AstroBB opened 2 years ago

AstroBB commented 2 years ago

Hi, I'm using deep prior in astronomy processing. This is an incredible process to remove random noise without introducing artefacts like a trained algorithm would do. I always have out of memory problems and Large GPU are too expansive. I have a very nice 32Gb GPU on my Mac M1 Max. Would anyone can give me some help to drop CUDA and make it work on a Mac M1 ?

One of my image that used deep prior was featured in NASA's Astronomy Picture Of the Day ! https://apod.nasa.gov/apod/ap191127.html

zcy5417 commented 2 years ago

已收到!祝每天开开心心!!

HaraldKorneliussen commented 2 years ago

I don't think Pytorch has support for newer Apple hardware yet, but tensorflow has.

Remember, this is a very small project, and what it does is as simple as it is brilliant. It's really just demonstration code for a paper. If you want to play with deep image priors, it's often easier to just reimplement it yourself than to try to adapt the code in this repository.

So I suggest you get a version of tensorflow that works with your hardware (remember to put it in a conda environment or similar so it doesn't mess with your native python install), and just be bold and write the code yourself.

For noise removal, it can be as simple as setting up a neural net that outputs images, and instead of training it on a big dataset of images, you train it over and over on the one image, optionally with a little different gaussian noise added each time.