Skip to content

Commit 3ff9f25

Browse files
committed
res101 cpu bugfix
1 parent 631a8c9 commit 3ff9f25

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ To generate realistic depth maps from a single image, this script uses code and
99
## Changelog
1010
* v0.2.8 bugfix
1111
* boost now also able to run on cpu
12+
* res101 able to compute on cpu
1213
* v0.2.7 separate tab
1314
* Depth Tab now available for stand-alone (batch) processing
1415
* v0.2.6 ui layout and settings

scripts/depthmap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ def run_depthmap(processed, outpath, inputimages, inputnames, compute_device, mo
193193
print(model_path)
194194
if not os.path.exists(model_path):
195195
download_file(model_path,"https://cloudstor.aarnet.edu.au/plus/s/lTIJF4vrvHCAI31/download")
196-
checkpoint = torch.load(model_path)
196+
if compute_device == 0:
197+
checkpoint = torch.load(model_path)
198+
else:
199+
checkpoint = torch.load(model_path,map_location=torch.device('cpu'))
197200
model = RelDepthModel(backbone='resnext101')
198201
model.load_state_dict(strip_prefix_if_present(checkpoint['depth_model'], "module."), strict=True)
199202
del checkpoint

0 commit comments

Comments
 (0)