owaiskha9654 commited on
Commit
00a50b3
·
1 Parent(s): 5d16f46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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/kadirnar/dethub/main/data/images/highway.jpg', 'highway.jpg')
9
- torch.hub.download_url_to_file('https://user-images.githubusercontent.com/34196005/142742872-1fefcc4d-d7e6-4c43-bbb7-6b5982f7e4ba.jpg', 'highway1.jpg')
10
- torch.hub.download_url_to_file('https://raw.githubusercontent.com/obss/sahi/main/tests/data/small-vehicles1.jpeg', 'small-vehicles1.jpeg')
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 = [['highway.jpg', 'owaiskha9654/yolov8-custom_objects', 224, 0.25, 0.45], ['highway1.jpg', 'owaiskha9654/yolov8-custom_objects', 224, 0.25, 0.45],]# ['small-vehicles1.jpeg', 'owaiskha9654/yolov8-custom_objects', 1280, 0.25, 0.45]]
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,