File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ # GFPGAN-onnxruntime-demo
2+ This is the onnxruntime inference code for GFP-GAN: Towards Real-World Blind Face Restoration with Generative Facial Prior (CVPR 2021). Official code: https://github.com/TencentARC/GFPGAN
3+
4+ ## convert torch to onnx.
5+ ```
6+ wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth
7+
8+ python torch2onnx.py --src_model_path ./GFPGANv1.3.pth --dst_model_path ./GFPGANv1.3.onnx --img_size 512
9+ ```
10+
11+ ## run onnx demo.
12+ ```
13+ python demo_onnx.py --model_path GFPGANv1.3.onnx --image_path ./cropped_faces/Adele_crop.png --save_path Adele_v2.jpg
14+ ```
15+
16+ | input | v1.2| v1.3 | v1.4|
17+ | :-: | :-:| :-:| :-:|
18+ | <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/cropped_faces/Adele_crop.png " height =" 60% " width =" 60% " >| <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/imgs/Adele_v2.jpg " height =" 60% " width =" 60% " >| <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/imgs/Adele_v3.jpg " height =" 60% " width =" 60% " >| <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/imgs/Adele_v4.jpg " height =" 60% " width =" 60% " >|
19+ | <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/cropped_faces/Justin_Timberlake_crop.png " height =" 60% " width =" 60% " >| <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/imgs/Justin_Timberlake_v2.jpg " height =" 60% " width =" 60% " >| <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/imgs/Justin_Timberlake_v3.jpg " height =" 60% " width =" 60% " >| <img src =" https://github.com/xuanandsix/GFPGAN-onnxruntime-demo/raw/main/imgs/Justin_Timberlake_v4.jpg " height =" 60% " width =" 60% " >|
You can’t perform that action at this time.
0 commit comments