zzl
commited on
Commit
·
65775ba
1
Parent(s):
39a6e03
[Release] cpu support
Browse files- demo_vid.py +2 -2
demo_vid.py
CHANGED
@@ -19,8 +19,8 @@ def vid2vid(model_type, video, iters):
|
|
19 |
model = model_dict[model_type]()
|
20 |
model.to(device)
|
21 |
ckpt_path = hf_hub_download(repo_id='lalala125/AMT', filename=f'{model_type.lower()}.pth')
|
22 |
-
ckpt = torch.load(ckpt_path)
|
23 |
-
model.load_state_dict(ckpt['state_dict']
|
24 |
model.eval()
|
25 |
vcap = cv2.VideoCapture(video)
|
26 |
ori_frame_rate = vcap.get(cv2.CAP_PROP_FPS)
|
|
|
19 |
model = model_dict[model_type]()
|
20 |
model.to(device)
|
21 |
ckpt_path = hf_hub_download(repo_id='lalala125/AMT', filename=f'{model_type.lower()}.pth')
|
22 |
+
ckpt = torch.load(ckpt_path, map_location=torch.device('cpu'))
|
23 |
+
model.load_state_dict(ckpt['state_dict'])
|
24 |
model.eval()
|
25 |
vcap = cv2.VideoCapture(video)
|
26 |
ori_frame_rate = vcap.get(cv2.CAP_PROP_FPS)
|