Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,10 +2,12 @@ import gradio as gr
|
|
2 |
from ultralyticsplus import YOLO, render_result
|
3 |
from ultralytics.yolo.utils.plotting import Annotator
|
4 |
|
|
|
5 |
model = YOLO('eeshawn11/naruto_hand_seal_detection')
|
6 |
model.conf = 0.50
|
7 |
model.iou = 0.45
|
8 |
model.overrides['max_det'] = 1
|
|
|
9 |
|
10 |
def yolov8_inference(
|
11 |
image: gr.Image = None,
|
|
|
2 |
from ultralyticsplus import YOLO, render_result
|
3 |
from ultralytics.yolo.utils.plotting import Annotator
|
4 |
|
5 |
+
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
6 |
model = YOLO('eeshawn11/naruto_hand_seal_detection')
|
7 |
model.conf = 0.50
|
8 |
model.iou = 0.45
|
9 |
model.overrides['max_det'] = 1
|
10 |
+
model.to(device)
|
11 |
|
12 |
def yolov8_inference(
|
13 |
image: gr.Image = None,
|