Spaces:
Sleeping
Sleeping
Commit
·
37d1dae
1
Parent(s):
6263059
Fix: argument mismatch
Browse files
app.py
CHANGED
@@ -26,19 +26,25 @@ def process_image(image, yolo_versions=["yolov5"]):
|
|
26 |
interface = gr.Interface(
|
27 |
fn=process_image,
|
28 |
inputs=[
|
29 |
-
gr.Image(
|
|
|
|
|
|
|
|
|
|
|
30 |
gr.CheckboxGroup(
|
31 |
choices=["yolov5", "yolov8s"],
|
32 |
-
value=["yolov5"], #
|
33 |
label="Select Model(s)",
|
|
|
34 |
),
|
35 |
],
|
36 |
outputs=gr.Gallery(label="Results", elem_id="gallery", rows=2, height=500),
|
37 |
title="Explainable AI for YOLO Models",
|
38 |
description="Upload an image or select a sample to visualize YOLO object detection with Grad-CAM.",
|
39 |
examples=[
|
40 |
-
[os.path.join(os.getcwd(), "data/xai/sample1.jpeg")],
|
41 |
-
[os.path.join(os.getcwd(), "data/xai/sample2.jpg")],
|
42 |
],
|
43 |
live=True
|
44 |
)
|
|
|
26 |
interface = gr.Interface(
|
27 |
fn=process_image,
|
28 |
inputs=[
|
29 |
+
gr.Image(
|
30 |
+
type="pil",
|
31 |
+
label="Upload an Image",
|
32 |
+
interactive=True,
|
33 |
+
value=None # This is where the sample image will be loaded when selected
|
34 |
+
),
|
35 |
gr.CheckboxGroup(
|
36 |
choices=["yolov5", "yolov8s"],
|
37 |
+
value=["yolov5"], # Ensure default value is set correctly
|
38 |
label="Select Model(s)",
|
39 |
+
type="value", # Ensure the value is passed as a list of selected models
|
40 |
),
|
41 |
],
|
42 |
outputs=gr.Gallery(label="Results", elem_id="gallery", rows=2, height=500),
|
43 |
title="Explainable AI for YOLO Models",
|
44 |
description="Upload an image or select a sample to visualize YOLO object detection with Grad-CAM.",
|
45 |
examples=[
|
46 |
+
[os.path.join(os.getcwd(), "data/xai/sample1.jpeg"), "yolov5"],
|
47 |
+
[os.path.join(os.getcwd(), "data/xai/sample2.jpg"), "yolov8s"],
|
48 |
],
|
49 |
live=True
|
50 |
)
|