Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ from PIL import Image
|
|
4 |
import numpy as np
|
5 |
import time
|
6 |
import os
|
7 |
-
from huggingface_hub import spaces as hf_spaces
|
8 |
|
9 |
# --- Import Custom Pipelines ---
|
10 |
# Ensure these files are in the same directory or accessible in PYTHONPATH
|
@@ -78,7 +77,7 @@ def get_mae_pipeline():
|
|
78 |
return mae_pipe_global
|
79 |
|
80 |
# --- Unified Prediction Function ---
|
81 |
-
@
|
82 |
def segment_image(input_image: Image.Image, model_choice: str) -> Image.Image:
|
83 |
"""
|
84 |
Takes a PIL Image and model choice, performs segmentation, and returns the segmented image.
|
|
|
4 |
import numpy as np
|
5 |
import time
|
6 |
import os
|
|
|
7 |
|
8 |
# --- Import Custom Pipelines ---
|
9 |
# Ensure these files are in the same directory or accessible in PYTHONPATH
|
|
|
77 |
return mae_pipe_global
|
78 |
|
79 |
# --- Unified Prediction Function ---
|
80 |
+
@spaces.GPU(duration=90)
|
81 |
def segment_image(input_image: Image.Image, model_choice: str) -> Image.Image:
|
82 |
"""
|
83 |
Takes a PIL Image and model choice, performs segmentation, and returns the segmented image.
|