Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import
|
2 |
import torch
|
3 |
import numpy as np
|
4 |
from transformers import AutoImageProcessor, AutoModelForDepthEstimation
|
@@ -88,7 +88,7 @@ def ade_palette() -> list[list[int]]:
|
|
88 |
|
89 |
|
90 |
@torch.inference_mode
|
91 |
-
@
|
92 |
def get_depth_image(image: Image) -> Image:
|
93 |
|
94 |
"""
|
@@ -116,7 +116,7 @@ def get_depth_image(image: Image) -> Image:
|
|
116 |
return image
|
117 |
|
118 |
@torch.inference_mode
|
119 |
-
@
|
120 |
def get_segmentation_of_room(image: Image):
|
121 |
#-> tuple[np.ndarray, Image]:
|
122 |
|
@@ -145,7 +145,7 @@ def get_segmentation_of_room(image: Image):
|
|
145 |
return seg_image
|
146 |
|
147 |
@torch.inference_mode
|
148 |
-
@
|
149 |
def interior_inference(image,
|
150 |
prompt,
|
151 |
negative_prompt="window, door, low resolution, banner, logo, watermark, text, deformed, blurry, out of focus, surreal, ugly, beginner",
|
|
|
1 |
+
import spacess
|
2 |
import torch
|
3 |
import numpy as np
|
4 |
from transformers import AutoImageProcessor, AutoModelForDepthEstimation
|
|
|
88 |
|
89 |
|
90 |
@torch.inference_mode
|
91 |
+
@spaces.GPU
|
92 |
def get_depth_image(image: Image) -> Image:
|
93 |
|
94 |
"""
|
|
|
116 |
return image
|
117 |
|
118 |
@torch.inference_mode
|
119 |
+
@spaces.GPU
|
120 |
def get_segmentation_of_room(image: Image):
|
121 |
#-> tuple[np.ndarray, Image]:
|
122 |
|
|
|
145 |
return seg_image
|
146 |
|
147 |
@torch.inference_mode
|
148 |
+
@spaces.GPU
|
149 |
def interior_inference(image,
|
150 |
prompt,
|
151 |
negative_prompt="window, door, low resolution, banner, logo, watermark, text, deformed, blurry, out of focus, surreal, ugly, beginner",
|