Spaces:
Runtime error
Runtime error
maduvantha
commited on
Commit
·
e54ea92
1
Parent(s):
e8b894c
Update demo.py
Browse files
demo.py
CHANGED
@@ -56,10 +56,11 @@ def load_checkpoints(config_path, checkpoint_path, cpu=True):
|
|
56 |
return generator, kp_detector
|
57 |
|
58 |
|
59 |
-
def make_animation(source_image, driving_video, generator, kp_detector, relative=True, adapt_movement_scale=True, cpu=
|
60 |
with torch.no_grad():
|
61 |
predictions = []
|
62 |
source = torch.tensor(source_image[np.newaxis].astype(np.float32)).permute(0, 3, 1, 2)
|
|
|
63 |
if not cpu:
|
64 |
source = source.cuda()
|
65 |
driving = torch.tensor(np.array(driving_video)[np.newaxis].astype(np.float32)).permute(0, 4, 1, 2, 3)
|
|
|
56 |
return generator, kp_detector
|
57 |
|
58 |
|
59 |
+
def make_animation(source_image, driving_video, generator, kp_detector, relative=True, adapt_movement_scale=True, cpu=True):
|
60 |
with torch.no_grad():
|
61 |
predictions = []
|
62 |
source = torch.tensor(source_image[np.newaxis].astype(np.float32)).permute(0, 3, 1, 2)
|
63 |
+
cpu=True
|
64 |
if not cpu:
|
65 |
source = source.cuda()
|
66 |
driving = torch.tensor(np.array(driving_video)[np.newaxis].astype(np.float32)).permute(0, 4, 1, 2, 3)
|