Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,7 @@ import torch
|
|
| 15 |
from diffusers import StableDiffusionBrushNetPipeline, BrushNetModel, UniPCMultistepScheduler
|
| 16 |
import random
|
| 17 |
import gradio as gr
|
|
|
|
| 18 |
|
| 19 |
mobile_sam = sam_model_registry['vit_h'](checkpoint='data/ckpt/sam_vit_h_4b8939.pth')
|
| 20 |
mobile_sam.eval()
|
|
@@ -73,6 +74,7 @@ def resize_image(input_image, resolution):
|
|
| 73 |
img = cv2.resize(input_image, (W, H), interpolation=cv2.INTER_LANCZOS4 if k > 1 else cv2.INTER_AREA)
|
| 74 |
return img
|
| 75 |
|
|
|
|
| 76 |
def process(input_image,
|
| 77 |
original_image,
|
| 78 |
original_mask,
|
|
|
|
| 15 |
from diffusers import StableDiffusionBrushNetPipeline, BrushNetModel, UniPCMultistepScheduler
|
| 16 |
import random
|
| 17 |
import gradio as gr
|
| 18 |
+
import spaces
|
| 19 |
|
| 20 |
mobile_sam = sam_model_registry['vit_h'](checkpoint='data/ckpt/sam_vit_h_4b8939.pth')
|
| 21 |
mobile_sam.eval()
|
|
|
|
| 74 |
img = cv2.resize(input_image, (W, H), interpolation=cv2.INTER_LANCZOS4 if k > 1 else cv2.INTER_AREA)
|
| 75 |
return img
|
| 76 |
|
| 77 |
+
@spaces.GPU
|
| 78 |
def process(input_image,
|
| 79 |
original_image,
|
| 80 |
original_mask,
|