Skip to content

Commit 12c3845

Browse files
committed
Added LR -> HR preview
1 parent b88dbb9 commit 12c3845

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

PULSE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def forward(self, ref_im,
187187
if (save_intermediate):
188188
yield (best_im.cpu().detach().clamp(0, 1),loss_builder.D(best_im).cpu().detach().clamp(0, 1))
189189

190-
if (min_l2 <= eps and min_face < distance):
190+
if (min_l2 <= eps and min_face <= distance):
191191
print("face distance reached!")
192192
break
193193

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,37 @@ The EPULSE can turn the low resolution face (256x256) into high resolution face
77
- Default trainable noise layers: 20
88
- Default steps: 1000
99

10-
Note: facenet-pytorc is required.
10+
Note: facenet-pytorch is required.
1111
```
1212
pip install facenet-pytorch
1313
```
14+
15+
## Pre-trained models to download
16+
- cache/shape_predictor_68_face_landmarks.dat
17+
https://drive.google.com/uc?id=1huhv8PYpNNKbGCLOaYUjOgR1pY5pmbJx
18+
- cache/synthesis.pt
19+
https://drive.google.com/uc?id=1TCViX1YpQyRsklTVYEJwdbmK91vklCo8
20+
- cache/mapping.pt
21+
https://drive.google.com/uc?id=14R6iHGf5iuVx3DMNsACAl7eBr7Vdpd0k
22+
23+
## How to run?
24+
1. put your LR photos into realpics and resize to 1024
25+
2. run align_face.py to align the faces into input folder
26+
3. go with run.py
27+
4. check your result in 'runs' folder
28+
1429
Alex Wei, 2020-8-23
1530

31+
## Preview
32+
33+
- Low Resolution: 256x256
34+
35+
![Transformation Preview](./readme_resources/liuyifei_lr.png)
36+
37+
- High Resolution: 1024x1024
38+
39+
![Transformation Preview](./readme_resources/liuyifei_hr.png)
40+
1641
# PULSE: Self-Supervised Photo Upsampling via Latent Space Exploration of Generative Models
1742
Code accompanying CVPR'20 paper of the same title. Paper link: https://arxiv.org/pdf/2003.03808.pdf
1843

readme_resources/liuyifei_hr.png

1.16 MB
Loading

readme_resources/liuyifei_lr.png

91 KB
Loading

run.py

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/python3
12
from PULSE import PULSE
23
from torch.utils.data import Dataset, DataLoader
34
from torch.nn import DataParallel

0 commit comments

Comments
 (0)