Spaces:
Running
on
Zero
Running
on
Zero
includes ZeroGPU deco for main function
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import torch
|
2 |
import os
|
3 |
import shutil
|
@@ -132,6 +133,7 @@ def run_inference(temp_dir, removed_bg_path):
|
|
132 |
except subprocess.CalledProcessError as e:
|
133 |
return f"Error during inference: {str(e)}"
|
134 |
|
|
|
135 |
def process_image(input_pil, remove_bg, progress=gr.Progress(track_tqdm=True)):
|
136 |
|
137 |
torch.cuda.empty_cache()
|
|
|
1 |
+
import spaces
|
2 |
import torch
|
3 |
import os
|
4 |
import shutil
|
|
|
133 |
except subprocess.CalledProcessError as e:
|
134 |
return f"Error during inference: {str(e)}"
|
135 |
|
136 |
+
@spaces.GPU(duration=90)
|
137 |
def process_image(input_pil, remove_bg, progress=gr.Progress(track_tqdm=True)):
|
138 |
|
139 |
torch.cuda.empty_cache()
|