Reference: https://github.com/chaofengc/PSFR-GAN
Prepare code:
%cd /content
!git clone https://github.com/chaofengc/PSFR-GAN.git
%mkdir -p /content/PSFR-GAN/pretrain_models
%cd /content/PSFR-GAN/pretrain_models
!gdown --id 1UhzMSORSul88iVfSYQYuEal83lEoNN7l
!gdown --id 1UiHeUHVNKiEq_s5dcBv6jez6TqrAduMg
!gdown --id 1UcTeI_-YmQeNypHW98VRuIF13xEPmPWm
!gdown --id 1Unn2eznkclqUhK_o50YUyaV7eoTE4Su3
!gdown --id 1P6jZRPKPq6g2DsVJevszbM1vL5HDO1fR
Prepare data:
%cd /content/PSFR-GAN
url = 'https://i.imgur.com/7gPVDg4.png'
!wget {url}
from pathlib import Path
test_img_path = Path(url).name
Run:
%cd /content/PSFR-GAN
!python test_enhance_single_unalign.py \
--test_img_path {test_img_path} \
--results_dir results \
--gpus 1
Export:
!tar czvf PSFRGAN.tar.gz /content/PSFR-GAN/results
I put this
%cd /content/PSFR-GAN
from google.colab import files
uploaded = files.upload()
test_img_path = 'X&A family2.png'
After
%cd /content/PSFR-GAN
!python test_enhance_single_unalign.py
--test_img_path {test_img_path}
--results_dir results
--gpus 1
And gave me this error
/content/PSFR-GAN
/bin/bash: A: command not found
----------------- Options ---------------
D_num: 3
Dinput_nc: 3
Dnorm: in
Gin_size: 512 [default: 512]
Gnorm: spade
Gout_size: 512 [default: 512]
Pimg_size: 512 [default: 512]
Pnorm: bn
aspect_ratio: 1.0
batch_size: 16
checkpoints_dir: ./check_points
crop_size: 256
data_device: cuda:0 [default: None]
dataroot: None
dataset_name: single
debug: False
device: cuda:0 [default: None]
epoch: latest
eval: False
gpu_ids: [0] [default: None]
gpus: 1
init_gain: 0.02
init_type: normal
input_nc: 3
isTrain: False [default: None]
load_iter: 0 [default: 0]
load_size: 256
max_dataset_size: inf
model: enhance
n_layers_D: 4
name: experiment_name
ndf: 64
ngf: 64
no_flip: False
ntest: inf
num_test: 50
num_threads: 8
output_nc: 3
parse_net_weight: ./pretrain_models/parse_multi_iter_90000.pth
phase: test
preprocess: none
psfr_net_weight: ./pretrain_models/psfrgan_epoch15_net_G.pth
results_dir: ./results/
save_masks_dir: ../datasets/FFHQ/masks512
seed: 123
serial_batches: False
src_dir:
suffix:
test_img_path: X [default: ]
test_upscale: 1
verbose: False
----------------- End -------------------
======> Loading images, crop and align faces.
Traceback (most recent call last):
File "test_enhance_single_unalign.py", line 101, in
img = dlib.load_rgb_image(img_path)
RuntimeError: Unable to open file: X