Ahsen Khaliq commited on
Commit
bb9918d
1 Parent(s): 18aaa8c

Update e4e_projection.py

Browse files
Files changed (1) hide show
  1. e4e_projection.py +7 -8
e4e_projection.py CHANGED
@@ -8,19 +8,18 @@ from argparse import Namespace
8
  from e4e.models.psp import pSp
9
  from util import *
10
 
11
- device = 'cpu'
12
- model_path = 'models/e4e_ffhq_encode.pt'
13
- ckpt = torch.load(model_path, map_location='cpu')
14
- opts = ckpt['opts']
15
- opts['checkpoint_path'] = model_path
16
- opts= Namespace(**opts)
17
- net = pSp(opts, device).eval().to(device)
18
 
19
  @ torch.no_grad()
20
  def projection(img, name, device='cuda'):
21
 
22
 
23
-
 
 
 
 
 
24
 
25
  transform = transforms.Compose(
26
  [
 
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
+ model_path = 'models/e4e_ffhq_encode.pt'
18
+ ckpt = torch.load(model_path, map_location='cpu')
19
+ opts = ckpt['opts']
20
+ opts['checkpoint_path'] = model_path
21
+ opts= Namespace(**opts)
22
+ net = pSp(opts, device).eval().to(device)
23
 
24
  transform = transforms.Compose(
25
  [