abheeshtroy / old-photo-restore-simplified

This is a reference implementation of paper Bringing Old Photos Back to Life, CVPR2020 (Oral) by Ziyu Wan1, Bo Zhang2, Dongdong Chen3, Pan Zhang4, Dong Chen2, Jing Liao1, Fang Wen2 City University of Hong Kong, Microsoft Research Asia, Microsoft Cloud AI, 4 USTC Through this colab notebook we have tried to modified the original implementation so that this can be easily used by any person with limited technical knowledge. And this appears like a web page for restoring their personal photos. Click on the play button at the corner of each code block. There are two code blocks. The first one is to download pre trained models, hence it takes some time. This first block needs to be executed only once for a session. The second block has to be played for each image. This notebook is created by shtadal ghosh and abheesht Roy
Apache License 2.0
0 stars 0 forks source link

Last Step Error - Image may be too large? #1

Open z3Nsk1Fh5a opened 3 years ago

z3Nsk1Fh5a commented 3 years ago

Thank you so kindly for putting a simplified notebook together.
Everything seems to works smoothly until the very end;

IMG_5837.JPG(image/jpeg) - 64753 bytes, last modified: 8/8/2021 - 100% done Saving IMG_5837.JPG to IMG_5837.JPG User uploaded file "IMG_5837.JPG" with length 64753 bytes /content/photo_restoration IMG_5837 IMG_5837.JPG Running Stage 1: Overall restoration initializing the dataloader model weights loaded directory of testing image: /content/photo_restoration/test_images/old processing IMG_5837.JPG You are using NL + Res Now you are processing IMG_5837.png Skip IMG_5837.png due to an error: CUDA out of memory. Tried to allocate 7.91 GiB (GPU 0; 15.90 GiB total capacity; 8.48 GiB already allocated; 1.89 GiB free; 13.10 GiB reserved in total by PyTorch) Finish Stage 1 ...

Running Stage 2: Face Detection Finish Stage 2 ...

Running Stage 3: Face Enhancement The main GPU is 0 dataset [FaceTestDataset] of size 0 was created The size of the latent vector size is [8,8] Network [SPADEGenerator] was created. Total number of parameters: 92.1 million. To see the architecture, do print(network). hi :) Finish Stage 3 ...

Running Stage 4: Blending Finish Stage 4 ...

All the processing is done. Please check the results.

FileNotFoundError Traceback (most recent call last)

in () 28 #download the enhanced image 29 ---> 30 files.download(out_path) 31 imo=PIL.Image.open(out_path) 32 print("Enhanced Image") /usr/local/lib/python3.7/dist-packages/google/colab/files.py in download(filename) 141 raise OSError(msg) 142 else: --> 143 raise FileNotFoundError(msg) # pylint: disable=undefined-variable 144 145 comm_manager = _IPython.get_ipython().kernel.comm_manager FileNotFoundError: Cannot find file: /content/photo_restoration/output/final_output/IMG_5837.png
z3Nsk1Fh5a commented 3 years ago

Im curious if the memory is running out due photo resolution? It is a very low quality but around 700x700 px face image. Im wondering if its based on resolution issues or something else.