Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,22 +8,6 @@ import numpy as np
|
|
| 8 |
from ultralytics import YOLO
|
| 9 |
import yolov5
|
| 10 |
|
| 11 |
-
# Image download
|
| 12 |
-
# file_urls = [
|
| 13 |
-
# ]
|
| 14 |
-
|
| 15 |
-
# def download_file(url, save_name):
|
| 16 |
-
# url = url
|
| 17 |
-
# if not os.path.exists(save_name):
|
| 18 |
-
# file = requests.get(url)
|
| 19 |
-
# open(save_name, 'wb').write(file.content)
|
| 20 |
-
|
| 21 |
-
# for i, url in enumerate(file_urls):
|
| 22 |
-
# download_file(
|
| 23 |
-
# file_urls[i],
|
| 24 |
-
# f"image_{i}.jpg"
|
| 25 |
-
# )
|
| 26 |
-
|
| 27 |
# Function for inference
|
| 28 |
def yolov5_inference(
|
| 29 |
image: gr.inputs.Image = None,
|
|
@@ -62,8 +46,7 @@ inputs = [
|
|
| 62 |
outputs = gr.outputs.Image(type="filepath", label="Output Image")
|
| 63 |
outputs_crops = gr.Gallery(label="Object crop")
|
| 64 |
|
| 65 |
-
title = "
|
| 66 |
-
description = "YOLOv5 is a family of object detection models pretrained on COCO dataset. This model is a pip implementation of the original YOLOv5 model."
|
| 67 |
|
| 68 |
# gradio examples: "Image", "Model", "Image Size", "Confidence Threshold", "IOU Threshold"
|
| 69 |
examples = [['1.jpg', 'Crime_Y5.pt', 640, 0.35, 0.45]
|
|
|
|
| 8 |
from ultralytics import YOLO
|
| 9 |
import yolov5
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Function for inference
|
| 12 |
def yolov5_inference(
|
| 13 |
image: gr.inputs.Image = None,
|
|
|
|
| 46 |
outputs = gr.outputs.Image(type="filepath", label="Output Image")
|
| 47 |
outputs_crops = gr.Gallery(label="Object crop")
|
| 48 |
|
| 49 |
+
title = "Perimeter security - to monitor suspicious human gestures"
|
|
|
|
| 50 |
|
| 51 |
# gradio examples: "Image", "Model", "Image Size", "Confidence Threshold", "IOU Threshold"
|
| 52 |
examples = [['1.jpg', 'Crime_Y5.pt', 640, 0.35, 0.45]
|