Spaces:
Runtime error
Runtime error
Commit
·
00a50b3
1
Parent(s):
5d16f46
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,9 +5,9 @@ from sahi.utils.cv import visualize_object_predictions, read_image
|
|
| 5 |
from ultralyticsplus import YOLO
|
| 6 |
|
| 7 |
# Images
|
| 8 |
-
torch.hub.download_url_to_file('https://raw.githubusercontent.com/
|
| 9 |
-
torch.hub.download_url_to_file('https://
|
| 10 |
-
torch.hub.download_url_to_file('https://raw.githubusercontent.com/
|
| 11 |
|
| 12 |
def yolov8_inference(
|
| 13 |
image: gr.inputs.Image = None,
|
|
@@ -37,6 +37,7 @@ def yolov8_inference(
|
|
| 37 |
if len(image_results)!=0:
|
| 38 |
image_predictions_in_xyxy_format = image_results#['det']
|
| 39 |
for pred in image_predictions_in_xyxy_format:
|
|
|
|
| 40 |
x1, y1, x2, y2 = (
|
| 41 |
int(pred[0]),
|
| 42 |
int(pred[1]),
|
|
@@ -72,7 +73,7 @@ inputs = [
|
|
| 72 |
outputs = gr.outputs.Image(type="filepath", label="Output Image")
|
| 73 |
title = "Ultralytics YOLOv8: State-of-the-Art YOLO Models"
|
| 74 |
|
| 75 |
-
examples = [['
|
| 76 |
demo_app = gr.Interface(
|
| 77 |
fn=yolov8_inference,
|
| 78 |
inputs=inputs,
|
|
|
|
| 5 |
from ultralyticsplus import YOLO
|
| 6 |
|
| 7 |
# Images
|
| 8 |
+
torch.hub.download_url_to_file('https://raw.githubusercontent.com/Owaiskhan9654/test_test/main/20.jpeg', '20.jpeg')
|
| 9 |
+
torch.hub.download_url_to_file('https://raw.githubusercontent.com/Owaiskhan9654/test_test/main/30.jpeg', '30.jpeg')
|
| 10 |
+
torch.hub.download_url_to_file('https://raw.githubusercontent.com/Owaiskhan9654/test_test/main/17.jpeg', '17.jpeg')
|
| 11 |
|
| 12 |
def yolov8_inference(
|
| 13 |
image: gr.inputs.Image = None,
|
|
|
|
| 37 |
if len(image_results)!=0:
|
| 38 |
image_predictions_in_xyxy_format = image_results#['det']
|
| 39 |
for pred in image_predictions_in_xyxy_format:
|
| 40 |
+
print(pred)
|
| 41 |
x1, y1, x2, y2 = (
|
| 42 |
int(pred[0]),
|
| 43 |
int(pred[1]),
|
|
|
|
| 73 |
outputs = gr.outputs.Image(type="filepath", label="Output Image")
|
| 74 |
title = "Ultralytics YOLOv8: State-of-the-Art YOLO Models"
|
| 75 |
|
| 76 |
+
examples = [['20.jpeg', 'owaiskha9654/yolov8-custom_objects', 224, 0.25, 0.45], ['30.jpeg', 'owaiskha9654/yolov8-custom_objects', 224, 0.25, 0.45],]# ['17.jpeg', 'owaiskha9654/yolov8-custom_objects', 1280, 0.25, 0.45]]
|
| 77 |
demo_app = gr.Interface(
|
| 78 |
fn=yolov8_inference,
|
| 79 |
inputs=inputs,
|