Alessio Grancini
commited on
Update monocular_depth_estimator.py
Browse files
monocular_depth_estimator.py
CHANGED
@@ -16,9 +16,9 @@ MODEL_FILE_URL = {
|
|
16 |
}
|
17 |
|
18 |
class MonocularDepthEstimator:
|
19 |
-
def __init__(self,
|
20 |
-
|
21 |
-
|
22 |
optimize=False,
|
23 |
side_by_side=False,
|
24 |
height=None,
|
|
|
16 |
}
|
17 |
|
18 |
class MonocularDepthEstimator:
|
19 |
+
def __init__(self, model_type="midas_v21_small_256", device="cpu"):
|
20 |
+
self.device = device
|
21 |
+
self.model, self.transform, *_ = load_model(self.device, f"models/{model_type}.pt", model_type)
|
22 |
optimize=False,
|
23 |
side_by_side=False,
|
24 |
height=None,
|