Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
from transparent_background import Remover
|
|
@@ -6,6 +7,7 @@ import numpy as np
|
|
| 6 |
# Initialize the model globally
|
| 7 |
remover = Remover()
|
| 8 |
|
|
|
|
| 9 |
def process_image(input_image, torchscript_jit, output_type):
|
| 10 |
global remover
|
| 11 |
if torchscript_jit == "on" and not isinstance(remover, Remover(jit=True).__class__):
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import gradio as gr
|
| 3 |
from PIL import Image
|
| 4 |
from transparent_background import Remover
|
|
|
|
| 7 |
# Initialize the model globally
|
| 8 |
remover = Remover()
|
| 9 |
|
| 10 |
+
@spaces.GPU
|
| 11 |
def process_image(input_image, torchscript_jit, output_type):
|
| 12 |
global remover
|
| 13 |
if torchscript_jit == "on" and not isinstance(remover, Remover(jit=True).__class__):
|