Reference: https://github.com/yangxy/GPEN
Prepare code:
%pip install ninja
%cd /content
!git clone https://github.com/yangxy/GPEN.git
%cd /content/GPEN/weights
!wget https://public-vigen-video.oss-cn-shanghai.aliyuncs.com/robin/models/RetinaFace-R50.pth
!wget https://public-vigen-video.oss-cn-shanghai.aliyuncs.com/robin/models/GPEN-512.pth
Prepare data:
%cd /content/GPEN/examples/imgs
# Remove the example input
%rm Solvay_conference_1927.png
# Upload your own images to Colab, or download images from Internet
!wget https://raw.githubusercontent.com/chaofengc/PSFRGAN/master/test_dir/test_hzgg.jpg -O example.jpg
!wget https://static.boredpanda.com/blog/wp-content/uploads/2017/03/childhood-celebrities-when-they-were-young-kids-101-58bd73a65dee9__700.jpg -O Adele.jpg
!wget https://static.boredpanda.com/blog/wp-content/uploads/2017/03/childhood-celebrities-when-they-were-young-kids-4-58b80eeeefa13__700.jpg -O Julia_Roberts.jpg
!wget https://i.imgur.com/sct87xb.png - O Star_Wars_meme.png
!wget https://i.imgur.com/7gPVDg4.png -O Gabe.png
Run:
%cd /content/GPEN
!python face_enhancement.py
Export:
!tar czvf GPEN.tar.gz /content/GPEN/examples/outs