Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,8 @@ import torch
|
|
| 10 |
from diffusers import StableDiffusionBrushNetPipeline, BrushNetModel, UniPCMultistepScheduler
|
| 11 |
import random
|
| 12 |
|
|
|
|
|
|
|
| 13 |
mobile_sam = sam_model_registry['vit_h'](checkpoint='data/ckpt/sam_vit_h_4b8939.pth').to("cuda")
|
| 14 |
mobile_sam.eval()
|
| 15 |
mobile_predictor = SamPredictor(mobile_sam)
|
|
@@ -61,7 +63,7 @@ def resize_image(input_image, resolution):
|
|
| 61 |
img = cv2.resize(input_image, (W, H), interpolation=cv2.INTER_LANCZOS4 if k > 1 else cv2.INTER_AREA)
|
| 62 |
return img
|
| 63 |
|
| 64 |
-
|
| 65 |
def process(input_image,
|
| 66 |
original_image,
|
| 67 |
original_mask,
|
|
|
|
| 10 |
from diffusers import StableDiffusionBrushNetPipeline, BrushNetModel, UniPCMultistepScheduler
|
| 11 |
import random
|
| 12 |
|
| 13 |
+
import spaces
|
| 14 |
+
|
| 15 |
mobile_sam = sam_model_registry['vit_h'](checkpoint='data/ckpt/sam_vit_h_4b8939.pth').to("cuda")
|
| 16 |
mobile_sam.eval()
|
| 17 |
mobile_predictor = SamPredictor(mobile_sam)
|
|
|
|
| 63 |
img = cv2.resize(input_image, (W, H), interpolation=cv2.INTER_LANCZOS4 if k > 1 else cv2.INTER_AREA)
|
| 64 |
return img
|
| 65 |
|
| 66 |
+
@spaces.GPU
|
| 67 |
def process(input_image,
|
| 68 |
original_image,
|
| 69 |
original_mask,
|