Display confidence
Browse files
app.py
CHANGED
@@ -68,22 +68,22 @@ def predict_image(image, threshold):
|
|
68 |
|
69 |
points = [(coord[0], coord[1]) for coord in coords]
|
70 |
draw.polygon(points, outline="red", width=LINE_WIDTH)
|
71 |
-
draw.text((points[0][0], points[0][1]), detection['class_name'], fill="red")
|
72 |
|
73 |
return image, img.shape, len(detections), duration
|
74 |
|
75 |
|
76 |
# Define example images and their true labels for users to choose from
|
77 |
example_data = [
|
78 |
-
["./demo/12ab97857.jpg", 0.
|
79 |
-
["./demo/82f13510a.jpg", 0.
|
80 |
-
["./demo/836f35381.jpg", 0.
|
81 |
-
["./demo/848d2afef.jpg", 0.
|
82 |
-
["./demo/911b25478.jpg", 0.
|
83 |
-
["./demo/b86e4046f.jpg", 0.
|
84 |
-
["./demo/ce2220f49.jpg", 0.
|
85 |
-
["./demo/d9762ef5e.jpg", 0.
|
86 |
-
["./demo/fa613751e.jpg", 0.
|
87 |
# Add more example images and thresholds as needed
|
88 |
|
89 |
]
|
@@ -96,7 +96,7 @@ css = """
|
|
96 |
}
|
97 |
"""
|
98 |
|
99 |
-
TITLE = "Ship detection on
|
100 |
|
101 |
# Define the Gradio Interface
|
102 |
demo = gr.Blocks(title=TITLE, css=css).queue()
|
|
|
68 |
|
69 |
points = [(coord[0], coord[1]) for coord in coords]
|
70 |
draw.polygon(points, outline="red", width=LINE_WIDTH)
|
71 |
+
draw.text((points[0][0], points[0][1]), detection['class_name'] + ' | ' + str(round(detection['confidence'], 3)), fill="red")
|
72 |
|
73 |
return image, img.shape, len(detections), duration
|
74 |
|
75 |
|
76 |
# Define example images and their true labels for users to choose from
|
77 |
example_data = [
|
78 |
+
["./demo/12ab97857.jpg", 0.6],
|
79 |
+
["./demo/82f13510a.jpg", 0.6],
|
80 |
+
["./demo/836f35381.jpg", 0.6],
|
81 |
+
["./demo/848d2afef.jpg", 0.6],
|
82 |
+
["./demo/911b25478.jpg", 0.6],
|
83 |
+
["./demo/b86e4046f.jpg", 0.6],
|
84 |
+
["./demo/ce2220f49.jpg", 0.6],
|
85 |
+
["./demo/d9762ef5e.jpg", 0.6],
|
86 |
+
["./demo/fa613751e.jpg", 0.6],
|
87 |
# Add more example images and thresholds as needed
|
88 |
|
89 |
]
|
|
|
96 |
}
|
97 |
"""
|
98 |
|
99 |
+
TITLE = "Ship detection on SPOT Satellite images (Oriented Bounding Boxes)"
|
100 |
|
101 |
# Define the Gradio Interface
|
102 |
demo = gr.Blocks(title=TITLE, css=css).queue()
|