VlaTal commited on
Commit
3f72a26
1 Parent(s): 19f43dc

added examples

Browse files
app.py CHANGED
@@ -1,10 +1,13 @@
1
  import gradio as gr
2
  from ultralytics import YOLO
3
  import numpy as np
 
4
 
5
  # Load YOLO model
6
  model = YOLO('./best.pt')
7
 
 
 
8
  def process_image(input_image):
9
  if input_image is not None:
10
  results = model(input_image)
@@ -21,7 +24,7 @@ iface = gr.Interface(
21
  outputs=gr.Image(), # Specify output as Gradio Image
22
  title="YOLOv8-obb ships detection",
23
  description="YOLOv8-obb trained on ShipRSImageNet_BAL-2",
24
- live=True)
25
 
26
  # Launch the Gradio interface
27
  iface.launch()
 
1
  import gradio as gr
2
  from ultralytics import YOLO
3
  import numpy as np
4
+ import os
5
 
6
  # Load YOLO model
7
  model = YOLO('./best.pt')
8
 
9
+ example_list = [["examples/" + example] for example in os.listdir("examples")]
10
+
11
  def process_image(input_image):
12
  if input_image is not None:
13
  results = model(input_image)
 
24
  outputs=gr.Image(), # Specify output as Gradio Image
25
  title="YOLOv8-obb ships detection",
26
  description="YOLOv8-obb trained on ShipRSImageNet_BAL-2",
27
+ examples=example_list)
28
 
29
  # Launch the Gradio interface
30
  iface.launch()
examples/ship_in_harbour.jpg ADDED
examples/ships.jpg ADDED
examples/ws_in_hb.jpg ADDED