Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
7bed26b
1
Parent(s):
e7bc6d5
First Deployment
Browse files- app.py +5 -3
- requirements.txt +0 -4
app.py
CHANGED
@@ -1,16 +1,18 @@
|
|
|
|
1 |
import spaces
|
2 |
import PIL.Image as Image
|
3 |
-
import gradio as gr
|
4 |
from ultralytics import ASSETS, YOLO
|
5 |
|
6 |
|
7 |
-
|
8 |
|
9 |
@spaces.GPU
|
10 |
def predict_image(img, conf_threshold, iou_threshold):
|
|
|
|
|
|
|
11 |
results = model.predict(
|
12 |
source=img,
|
13 |
-
device="cuda:0",
|
14 |
conf=conf_threshold,
|
15 |
iou=iou_threshold,
|
16 |
show_labels=True,
|
|
|
1 |
+
import gradio as gr
|
2 |
import spaces
|
3 |
import PIL.Image as Image
|
|
|
4 |
from ultralytics import ASSETS, YOLO
|
5 |
|
6 |
|
7 |
+
|
8 |
|
9 |
@spaces.GPU
|
10 |
def predict_image(img, conf_threshold, iou_threshold):
|
11 |
+
|
12 |
+
model = YOLO("best.pt")
|
13 |
+
|
14 |
results = model.predict(
|
15 |
source=img,
|
|
|
16 |
conf=conf_threshold,
|
17 |
iou=iou_threshold,
|
18 |
show_labels=True,
|
requirements.txt
CHANGED
@@ -1,5 +1 @@
|
|
1 |
ultralytics
|
2 |
-
pytorch
|
3 |
-
torch
|
4 |
-
torchvision
|
5 |
-
opencv-python
|
|
|
1 |
ultralytics
|
|
|
|
|
|
|
|