Spaces:
Runtime error
Runtime error
image uri added for sample image to download
Browse files- app.py +0 -3
- classify_utils.py +5 -1
- detect_utils.py +4 -0
app.py
CHANGED
@@ -1,10 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from classify_utils import classify_tab
|
3 |
from detect_utils import detect_tab
|
4 |
-
import os
|
5 |
|
6 |
-
os.system("wget https://media.roboflow.com/notebooks/examples/dog.jpeg")
|
7 |
-
os.system("wget https://media.roboflow.com/notebooks/examples/dog-2.jpeg")
|
8 |
|
9 |
if __name__ == '__main__':
|
10 |
gr.TabbedInterface(
|
|
|
1 |
import gradio as gr
|
2 |
from classify_utils import classify_tab
|
3 |
from detect_utils import detect_tab
|
|
|
4 |
|
|
|
|
|
5 |
|
6 |
if __name__ == '__main__':
|
7 |
gr.TabbedInterface(
|
classify_utils.py
CHANGED
@@ -3,6 +3,10 @@ import os
|
|
3 |
from ultralytics import YOLO
|
4 |
import requests
|
5 |
import supervision as sv
|
|
|
|
|
|
|
|
|
6 |
|
7 |
response = requests.get("https://git.io/JJkYN")
|
8 |
labels = response.text.split("\n")
|
@@ -37,6 +41,6 @@ classify_tab = gr.Interface(
|
|
37 |
inputs=inputs_thresh,
|
38 |
outputs=gr.outputs.Label(num_top_classes=4),
|
39 |
title="supervision",
|
40 |
-
examples=[["
|
41 |
description="Gradio based demo for <a href='https://github.com/roboflow/supervision' style='text-decoration: underline' target='_blank'>roboflow/supervision</a>, We write your reusable computer vision tools."
|
42 |
)
|
|
|
3 |
from ultralytics import YOLO
|
4 |
import requests
|
5 |
import supervision as sv
|
6 |
+
import os
|
7 |
+
|
8 |
+
os.system("wget https://datasets-server.huggingface.co/cached-assets/imagenet-1k/--/default/test/27/image/image1.jpg")
|
9 |
+
os.system("wget https://datasets-server.huggingface.co/cached-assets/imagenet-1k/--/default/test/22/image/image2.jpg")
|
10 |
|
11 |
response = requests.get("https://git.io/JJkYN")
|
12 |
labels = response.text.split("\n")
|
|
|
41 |
inputs=inputs_thresh,
|
42 |
outputs=gr.outputs.Label(num_top_classes=4),
|
43 |
title="supervision",
|
44 |
+
examples=[["image1.jpg", "yolov8s-cls"], ["image2.jpg", "yolov8n-cls"]],
|
45 |
description="Gradio based demo for <a href='https://github.com/roboflow/supervision' style='text-decoration: underline' target='_blank'>roboflow/supervision</a>, We write your reusable computer vision tools."
|
46 |
)
|
detect_utils.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from ultralytics import YOLO
|
3 |
import supervision as sv
|
|
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
def detect(image, weights, slider_val):
|
|
|
1 |
import gradio as gr
|
2 |
from ultralytics import YOLO
|
3 |
import supervision as sv
|
4 |
+
import os
|
5 |
+
|
6 |
+
os.system("wget https://media.roboflow.com/notebooks/examples/dog.jpeg")
|
7 |
+
os.system("wget https://media.roboflow.com/notebooks/examples/dog-2.jpeg")
|
8 |
|
9 |
|
10 |
def detect(image, weights, slider_val):
|