Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
e744170
1
Parent(s):
873b591
Update e4e_projection.py
Browse files- e4e_projection.py +7 -7
e4e_projection.py
CHANGED
|
@@ -8,17 +8,17 @@ from argparse import Namespace
|
|
| 8 |
from e4e.models.psp import pSp
|
| 9 |
from util import *
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
@ torch.no_grad()
|
| 14 |
def projection(img, name, device='cuda'):
|
| 15 |
|
| 16 |
-
|
| 17 |
-
ckpt = torch.load(model_path, map_location='cpu')
|
| 18 |
-
opts = ckpt['opts']
|
| 19 |
-
opts['checkpoint_path'] = model_path
|
| 20 |
-
opts= Namespace(**opts)
|
| 21 |
-
net = pSp(opts, device).eval().to(device)
|
| 22 |
|
| 23 |
|
| 24 |
transform = transforms.Compose(
|
|
|
|
| 8 |
from e4e.models.psp import pSp
|
| 9 |
from util import *
|
| 10 |
|
| 11 |
+
model_path = 'models/e4e_ffhq_encode.pt'
|
| 12 |
+
ckpt = torch.load(model_path, map_location='cpu')
|
| 13 |
+
opts = ckpt['opts']
|
| 14 |
+
opts['checkpoint_path'] = model_path
|
| 15 |
+
opts= Namespace(**opts)
|
| 16 |
+
net = pSp(opts, device).eval().to(device)
|
| 17 |
|
| 18 |
@ torch.no_grad()
|
| 19 |
def projection(img, name, device='cuda'):
|
| 20 |
|
| 21 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
transform = transforms.Compose(
|