Spaces:
Runtime error
Runtime error
Update preprocessor.py
Browse files- preprocessor.py +3 -3
preprocessor.py
CHANGED
|
@@ -18,7 +18,7 @@ from controlnet_aux import (
|
|
| 18 |
from controlnet_aux.util import HWC3
|
| 19 |
from transformers import pipeline
|
| 20 |
# from cv_utils import resize_image
|
| 21 |
-
|
| 22 |
|
| 23 |
|
| 24 |
class DepthEstimator:
|
|
@@ -74,8 +74,8 @@ class Preprocessor:
|
|
| 74 |
elif name == "Canny":
|
| 75 |
self.model = CannyDetector()
|
| 76 |
elif name == "Depth":
|
| 77 |
-
|
| 78 |
-
self.model = MidasDetector.from_pretrained(self.MODEL_ID)
|
| 79 |
else:
|
| 80 |
raise ValueError
|
| 81 |
torch.cuda.empty_cache()
|
|
|
|
| 18 |
from controlnet_aux.util import HWC3
|
| 19 |
from transformers import pipeline
|
| 20 |
# from cv_utils import resize_image
|
| 21 |
+
from depth_estimator import DepthEstimator
|
| 22 |
|
| 23 |
|
| 24 |
class DepthEstimator:
|
|
|
|
| 74 |
elif name == "Canny":
|
| 75 |
self.model = CannyDetector()
|
| 76 |
elif name == "Depth":
|
| 77 |
+
self.model = DepthEstimator()
|
| 78 |
+
# self.model = MidasDetector.from_pretrained(self.MODEL_ID)
|
| 79 |
else:
|
| 80 |
raise ValueError
|
| 81 |
torch.cuda.empty_cache()
|