Spaces:
Running
on
Zero
Running
on
Zero
rizavelioglu
commited on
Commit
•
62e7cee
1
Parent(s):
d7a5aaa
run spaces on zero-GPU
Browse files- app.py +2 -0
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import json
|
2 |
import random
|
|
|
3 |
|
4 |
import gradio as gr
|
5 |
import matplotlib.pyplot as plt
|
@@ -133,6 +134,7 @@ def draw_predictions(
|
|
133 |
return imgs_list
|
134 |
|
135 |
|
|
|
136 |
def inference(image, model_name, mask_threshold, bbox_threshold):
|
137 |
"""
|
138 |
Load the ONNX model and run inference with the provided input `image`. Visualize the predictions and save them in a
|
|
|
1 |
import json
|
2 |
import random
|
3 |
+
import spaces
|
4 |
|
5 |
import gradio as gr
|
6 |
import matplotlib.pyplot as plt
|
|
|
134 |
return imgs_list
|
135 |
|
136 |
|
137 |
+
@spaces.GPU
|
138 |
def inference(image, model_name, mask_threshold, bbox_threshold):
|
139 |
"""
|
140 |
Load the ONNX model and run inference with the provided input `image`. Visualize the predictions and save them in a
|
requirements.txt
CHANGED
@@ -4,4 +4,5 @@ torchvision>=0.17.1
|
|
4 |
matplotlib>=3.8.3
|
5 |
numpy>=1.26.4
|
6 |
pillow>=10.2.0
|
7 |
-
gradio>=4.26.0
|
|
|
|
4 |
matplotlib>=3.8.3
|
5 |
numpy>=1.26.4
|
6 |
pillow>=10.2.0
|
7 |
+
gradio>=4.26.0
|
8 |
+
spaces>=0.26.2
|