From 49dd36ce4a277929831f09d978721b3fdb87eb25 Mon Sep 17 00:00:00 2001 From: Laurynas Riliskis Date: Sat, 18 Apr 2020 14:25:54 -0700 Subject: [PATCH] Script defaulting to CPU, changing to cuda with cpu fallback --- MiDaS/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MiDaS/run.py b/MiDaS/run.py index ac27f3e..d9a6504 100644 --- a/MiDaS/run.py +++ b/MiDaS/run.py @@ -22,7 +22,7 @@ def run_depth(img_names, input_path, output_path, model_path, Net, utils, target print("initialize") # select device - device = torch.device("cpu") + device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') print("device: %s" % device) # load network