Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -48,8 +48,8 @@ def attempt_download_from_hub(repo_id, hf_token=None):
|
|
48 |
|
49 |
@spaces.GPU(duration=10)
|
50 |
def LeYOLO_inference(image, model_id, image_size, conf_threshold, iou_threshold):
|
51 |
-
MODEL_PATH = attempt_download_from_hub(model_id)
|
52 |
-
model = model = YOLO(
|
53 |
model.to('cuda')
|
54 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
55 |
detections = sv.Detections.from_ultralytics(results)
|
@@ -77,12 +77,12 @@ def app():
|
|
77 |
model_id = gr.Dropdown(
|
78 |
label="Model",
|
79 |
choices=[
|
80 |
-
"
|
81 |
-
"
|
82 |
-
"
|
83 |
-
"
|
84 |
],
|
85 |
-
value="
|
86 |
)
|
87 |
image_size = gr.Slider(
|
88 |
label="Image Size",
|
@@ -126,14 +126,14 @@ def app():
|
|
126 |
examples=[
|
127 |
[
|
128 |
"dog.jpeg",
|
129 |
-
"
|
130 |
640,
|
131 |
0.25,
|
132 |
0.45,
|
133 |
],
|
134 |
[
|
135 |
"zidane.jpg",
|
136 |
-
"
|
137 |
640,
|
138 |
0.25,
|
139 |
0.45,
|
|
|
48 |
|
49 |
@spaces.GPU(duration=10)
|
50 |
def LeYOLO_inference(image, model_id, image_size, conf_threshold, iou_threshold):
|
51 |
+
# MODEL_PATH = attempt_download_from_hub(model_id)
|
52 |
+
model = model = YOLO.from_pretrained(model_id)
|
53 |
model.to('cuda')
|
54 |
results = model(source=image, imgsz=image_size, iou=iou_threshold, conf=conf_threshold, verbose=False)[0]
|
55 |
detections = sv.Detections.from_ultralytics(results)
|
|
|
77 |
model_id = gr.Dropdown(
|
78 |
label="Model",
|
79 |
choices=[
|
80 |
+
"lhollard/leyolo-nano",
|
81 |
+
"lhollard/leyolo-small",
|
82 |
+
"lhollard/leyolo-medium",
|
83 |
+
"lhollard/leyolo-large",
|
84 |
],
|
85 |
+
value="lhollard/leyolo-medium",
|
86 |
)
|
87 |
image_size = gr.Slider(
|
88 |
label="Image Size",
|
|
|
126 |
examples=[
|
127 |
[
|
128 |
"dog.jpeg",
|
129 |
+
"lhollard/leyolo-medium",
|
130 |
640,
|
131 |
0.25,
|
132 |
0.45,
|
133 |
],
|
134 |
[
|
135 |
"zidane.jpg",
|
136 |
+
"lhollard/leyolo-medium",
|
137 |
640,
|
138 |
0.25,
|
139 |
0.45,
|