microsoft / Bringing-Old-Photos-Back-to-Life

Bringing Old Photo Back to Life (CVPR 2020 oral)
https://arxiv.org/abs/2004.09484
MIT License
15.15k stars 2k forks source link

Face enhancement erroring result #261

Open xh4010 opened 1 year ago

xh4010 commented 1 year ago

I ran the python GUI. py command, and there was no error, but the generated face image was wrong

Running Stage 1: Overall restoration
detection.py:25: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
  def data_transforms(img, full_size, method=Image.BICUBIC):
initializing the dataloader
model weights loaded
directory of testing image: G:\DeepLearning\pytorch\Bringing-Old-Photos-Back-to-Life-master\test_images\old_w_scratch
processing a.png
processing b.png
processing c.png
processing d.png
test.py:18: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
  def data_transforms(img, method=Image.BILINEAR, scale=False):
You are using NL + Res
Now you are processing a.png
Now you are processing b.png
Now you are processing c.png
Now you are processing d.png
Finish Stage 1 ...

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

Running Stage 3: Face Enhancement
The main GPU is
0
dataset [FaceTestDataset] of size 5 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.

zhaop-l commented 1 year ago

I have encountered the same problem as you. How did you solve it? image

m45t3rc0d3r commented 1 year ago

I have the same problem. Anybody has a solution for this?

Haoming02 commented 11 months ago

I stumbled upon this problem as well while developing this Extension

For me, the issue lies in the fact that the default path for the Face Enhancement checkpoints is set to ./checkpoints. And since I modified and ran the scripts from elsewhere, the path simply pointed to nothing. The funny thing is that, finding no checkpoints does not raise any error at all. That's why it's simply generating noises.

TL;DR: Adding --checkpoints_dir <path to checkpoints folder> while calling test_face.py solved this issue for me.