Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,12 +61,12 @@ from transformers import Mask2FormerImageProcessor, Mask2FormerForUniversalSegme
|
|
| 61 |
# Load Mask2Former
|
| 62 |
processor = Mask2FormerImageProcessor.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
|
| 63 |
model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
|
| 64 |
-
model = model.
|
| 65 |
|
| 66 |
# Load Depth model
|
| 67 |
depth_image_processor = AutoImageProcessor.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
|
| 68 |
depth_model = AutoModelForDepthEstimation.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
|
| 69 |
-
depth_model = depth_model.
|
| 70 |
|
| 71 |
def to_rgb(color: str) -> tuple:
|
| 72 |
return tuple(int(color[i:i+2], 16) for i in (1, 3, 5))
|
|
|
|
| 61 |
# Load Mask2Former
|
| 62 |
processor = Mask2FormerImageProcessor.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
|
| 63 |
model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-large-ade-semantic")
|
| 64 |
+
model = model.to(DEVICE)
|
| 65 |
|
| 66 |
# Load Depth model
|
| 67 |
depth_image_processor = AutoImageProcessor.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
|
| 68 |
depth_model = AutoModelForDepthEstimation.from_pretrained("LiheYoung/depth-anything-large-hf", torch_dtype=torch.float16)
|
| 69 |
+
depth_model = depth_model.to(DEVICE)
|
| 70 |
|
| 71 |
def to_rgb(color: str) -> tuple:
|
| 72 |
return tuple(int(color[i:i+2], 16) for i in (1, 3, 5))
|