Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -7,20 +7,15 @@ import gradio as gr
|
|
7 |
import torch
|
8 |
from inferer import Inferer
|
9 |
|
10 |
-
pipeline = Inferer(
|
11 |
-
print(f"GPU on? {'🟢' if pipeline.device.type != 'cpu' else '🔴'}")
|
12 |
-
|
13 |
-
|
14 |
-
def fn_image(image, conf_thres, iou_thres):
|
15 |
-
return pipeline(image, conf_thres, iou_thres)
|
16 |
-
|
17 |
|
|
|
|
|
|
|
18 |
gr.Interface(
|
19 |
fn_image,
|
20 |
inputs=[
|
21 |
gr.Image(source='webcam', streaming=True),
|
22 |
-
gr.Slider(0, 1, value=0.5, label="Confidence Threshold"),
|
23 |
-
gr.Slider(0, 1, value=0.5, label="IOU Threshold"),
|
24 |
],
|
25 |
outputs=gr.Image(type="file"),
|
26 |
live=True,
|
|
|
7 |
import torch
|
8 |
from inferer import Inferer
|
9 |
|
10 |
+
pipeline = Inferer(pipeline = Inferer(predict.py, model='yolov8x6.pt', source='webcam'))
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
def fn_image(image):
|
13 |
+
return pipeline(image)
|
14 |
+
|
15 |
gr.Interface(
|
16 |
fn_image,
|
17 |
inputs=[
|
18 |
gr.Image(source='webcam', streaming=True),
|
|
|
|
|
19 |
],
|
20 |
outputs=gr.Image(type="file"),
|
21 |
live=True,
|