Views
No views yet
1# inference only
2pip install -r requirements-infer.txt
3# inference & evaluation
4pip install -r requirements-eval.txtCelebA-Test (LQ) and CelebA-Test (HQ) from GFP-GAN homepage1└── datasets
2 └── celeba_512_validation
3 ├── 00000000.png
4 ├── ...
5 ├── celeba_512_validation_lq
6 ├── 00000000.png
7 ├── ...
81python onnx_inference.py --onnx psfrgan_nchw_fp32.onnx --latent latent.npy --input /Path/To/Image --out-dir outputs
2python onnx_inference.py --onnx psfrgan_nhwc_int8.onnx --latent latent.npy --input /Path/To/Image --out-dir outputs--input: Accepts either a single image file path or a directory path. If it's a file, the script will process that image only. If it's a directory, the script will recursively scan for .png, .jpg, and .jpeg files and process all of them.--latent: (Optional) Path to the latent code file (.npy). If not provided, random latent values will be generated with a fixed seed for reproducibility.--out-dir: Output directory where the restored images will be saved.1# eval fp32
2python onnx_eval.py \
3 --onnx psfrgan_nchw_fp32.onnx \
4 --latent latent.npy \
5 --hq-dir datasets/celeba_512_validation \
6 --lq-dir datasets/celeba_512_validation_lq \
7 --out-dir outputs/fp32 -clean
8
9# eval int8
10python onnx_eval.py \
11 --onnx psfrgan_nhwc_int8.onnx \
12 --latent latent.npy \
13 --hq-dir datasets/celeba_512_validation \
14 --lq-dir datasets/celeba_512_validation_lq \
15 --out-dir outputs/int8 -clean| Model | PSNR(↑) | MS_SSIM(↑) | FID(↓) |
|---|---|---|---|
| PSFRGAN (fp32) | 25.27 | 0.8500 | 21.99 |
| PSFRGAN (int8) | 25.27 | 0.8487 | 24.34 |
1@inproceedings{ChenPSFRGAN,
2 author = {Chen, Chaofeng and Li, Xiaoming and Lingbo, Yang and Lin, Xianhui and Zhang, Lei and Wong, Kwan-Yee~K.},
3 title = {Progressive Semantic-Aware Style Transformation for Blind Face Restoration},
4 Journal = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
5 year = {2021}
6}