Downloads · 30 days
0
amd/ryzenai-psfrgan
ryzenai-psfrgan is a machine learning model from amd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
The model operates at 512x512 resolution and is particularly effective at restoring faces with various degradations including blur, noise, and low resolution.
Downloads · 30 days
0
Access
Public
Updated Jan 21, 2026
Repo size
52.7 MB
Likes
1
Public
Click a slice to open those files.
.onnx51.6 MB · 98%
From the Hugging Face model README
The model operates at 512x512 resolution and is particularly effective at restoring faces with various degradations including blur, noise, and low resolution.
It was introduced in the paper Progressive Semantic-Aware Style Transformation for Blind Face Restoration by Chaofeng Chen et al. at CVPR 2021.
We have developed a modified version optimized for AMD Ryzen AI.
PSFRGAN (Progressive Semantic-aware Face Restoration Generative Adversarial Network) is a deep learning model designed for blind face restoration, capable of recovering high-quality face images from severely degraded inputs.
You can use this model for face restoration tasks. See the model hub for all available psfrgan models.
# inference only
pip install -r requirements-infer.txt
# inference & evaluation
pip install -r requirements-eval.txt
CelebA-Test (LQ) and CelebA-Test (HQ) from GFP-GAN homepage└── datasets
└── celeba_512_validation
├── 00000000.png
├── ...
├── celeba_512_validation_lq
├── 00000000.png
├── ...
python onnx_inference.py --onnx psfrgan_nchw_fp32.onnx --latent latent.npy --input /Path/To/Image --out-dir outputs
python onnx_inference.py --onnx psfrgan_nhwc_int8.onnx --latent latent.npy --input /Path/To/Image --out-dir outputs
Arguments:
--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.
# eval fp32
python onnx_eval.py \
--onnx psfrgan_nchw_fp32.onnx \
--latent latent.npy \
--hq-dir datasets/celeba_512_validation \
--lq-dir datasets/celeba_512_validation_lq \
--out-dir outputs/fp32 -clean
# eval int8
python onnx_eval.py \
--onnx psfrgan_nhwc_int8.onnx \
--latent latent.npy \
--hq-dir datasets/celeba_512_validation \
--lq-dir datasets/celeba_512_validation_lq \
--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 |
@inproceedings{ChenPSFRGAN,
author = {Chen, Chaofeng and Li, Xiaoming and Lingbo, Yang and Lin, Xianhui and Zhang, Lei and Wong, Kwan-Yee~K.},
title = {Progressive Semantic-Aware Style Transformation for Blind Face Restoration},
Journal = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2021}
}