[Release] cpu support
Browse files- demo_img.py +2 -2
demo_img.py
CHANGED
@@ -19,8 +19,8 @@ def img2vid(model_type, img0, img1, frame_ratio, iters):
|
|
19 |
model.to(device)
|
20 |
ckpt_path = hf_hub_download(repo_id='lalala125/AMT', filename=f'{model_type.lower()}.pth')
|
21 |
print(model_type)
|
22 |
-
ckpt = torch.load(ckpt_path)
|
23 |
-
model.load_state_dict(ckpt['state_dict']
|
24 |
model.eval()
|
25 |
img0_t = img2tensor(img0).to(device)
|
26 |
img1_t = img2tensor(img1).to(device)
|
|
|
19 |
model.to(device)
|
20 |
ckpt_path = hf_hub_download(repo_id='lalala125/AMT', filename=f'{model_type.lower()}.pth')
|
21 |
print(model_type)
|
22 |
+
ckpt = torch.load(ckpt_path, map_location=torch.device('cpu'))
|
23 |
+
model.load_state_dict(ckpt['state_dict'])
|
24 |
model.eval()
|
25 |
img0_t = img2tensor(img0).to(device)
|
26 |
img1_t = img2tensor(img1).to(device)
|