Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,8 +71,6 @@ def download_models():
|
|
| 71 |
for model, (url, folder, filename) in models.items():
|
| 72 |
download_file(url, folder, filename)
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
def timer_func(func):
|
| 77 |
def wrapper(*args, **kwargs):
|
| 78 |
start_time = time.time()
|
|
@@ -259,6 +257,7 @@ def get_segmentation_pipeline(
|
|
| 259 |
|
| 260 |
@torch.inference_mode()
|
| 261 |
@spaces.GPU
|
|
|
|
| 262 |
def segment_image(
|
| 263 |
image: Image,
|
| 264 |
image_processor: AutoImageProcessor,
|
|
@@ -304,6 +303,7 @@ def get_depth_pipeline():
|
|
| 304 |
|
| 305 |
@torch.inference_mode()
|
| 306 |
@spaces.GPU
|
|
|
|
| 307 |
def get_depth_image(
|
| 308 |
image: Image,
|
| 309 |
feature_extractor: AutoImageProcessor,
|
|
@@ -372,6 +372,7 @@ class ControlNetDepthDesignModelMulti:
|
|
| 372 |
self.additional_quality_suffix = "interior design, 4K, high resolution, photorealistic"
|
| 373 |
|
| 374 |
@spaces.GPU
|
|
|
|
| 375 |
def generate_design(self, empty_room_image: Image, prompt: str, guidance_scale: int = 10, num_steps: int = 50, strength: float =0.9, img_size: int = 640) -> Image:
|
| 376 |
"""
|
| 377 |
Given an image of an empty room and a prompt
|
|
@@ -552,7 +553,7 @@ def main():
|
|
| 552 |
with gr.Blocks() as demo:
|
| 553 |
gr.Markdown(title)
|
| 554 |
gr.Markdown(description)
|
| 555 |
-
create_demo()
|
| 556 |
|
| 557 |
|
| 558 |
demo.queue().launch(share=False)
|
|
|
|
| 71 |
for model, (url, folder, filename) in models.items():
|
| 72 |
download_file(url, folder, filename)
|
| 73 |
|
|
|
|
|
|
|
| 74 |
def timer_func(func):
|
| 75 |
def wrapper(*args, **kwargs):
|
| 76 |
start_time = time.time()
|
|
|
|
| 257 |
|
| 258 |
@torch.inference_mode()
|
| 259 |
@spaces.GPU
|
| 260 |
+
@timer_func
|
| 261 |
def segment_image(
|
| 262 |
image: Image,
|
| 263 |
image_processor: AutoImageProcessor,
|
|
|
|
| 303 |
|
| 304 |
@torch.inference_mode()
|
| 305 |
@spaces.GPU
|
| 306 |
+
@timer_func
|
| 307 |
def get_depth_image(
|
| 308 |
image: Image,
|
| 309 |
feature_extractor: AutoImageProcessor,
|
|
|
|
| 372 |
self.additional_quality_suffix = "interior design, 4K, high resolution, photorealistic"
|
| 373 |
|
| 374 |
@spaces.GPU
|
| 375 |
+
@timer_func
|
| 376 |
def generate_design(self, empty_room_image: Image, prompt: str, guidance_scale: int = 10, num_steps: int = 50, strength: float =0.9, img_size: int = 640) -> Image:
|
| 377 |
"""
|
| 378 |
Given an image of an empty room and a prompt
|
|
|
|
| 553 |
with gr.Blocks() as demo:
|
| 554 |
gr.Markdown(title)
|
| 555 |
gr.Markdown(description)
|
| 556 |
+
create_demo(model)
|
| 557 |
|
| 558 |
|
| 559 |
demo.queue().launch(share=False)
|