Skip to content

Instantly share code, notes, and snippets.

@woctezuma
Last active June 15, 2021 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woctezuma/ecfc9849fac9f8d99edd7c1d6d03758a to your computer and use it in GitHub Desktop.
Save woctezuma/ecfc9849fac9f8d99edd7c1d6d03758a to your computer and use it in GitHub Desktop.
Google Colab: GPEN

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment