Spaces:
Sleeping
Sleeping
Commit
·
e3b086b
1
Parent(s):
e7d8bd5
Fix: argument mismatch
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ interface = gr.Interface(
|
|
30 |
type="pil",
|
31 |
label="Upload an Image",
|
32 |
interactive=True,
|
33 |
-
value=None,
|
34 |
),
|
35 |
gr.CheckboxGroup(
|
36 |
choices=["yolov5", "yolov8s"],
|
@@ -47,16 +47,10 @@ interface = gr.Interface(
|
|
47 |
[os.path.join(os.getcwd(), "data/xai/sample2.jpg")],
|
48 |
],
|
49 |
live=True,
|
50 |
-
allow_flagging="never", # Optional: Disable flagging if not required
|
51 |
)
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
return os.path.join(os.getcwd(), os.path.join(os.getcwd(), "data/xai/sample1.jpeg"))
|
56 |
-
return image
|
57 |
-
|
58 |
-
# Update the interface to use the sample selection logic
|
59 |
-
interface.inputs[0].update(value=select_sample_image(None))
|
60 |
|
61 |
|
62 |
if __name__ == "__main__":
|
|
|
30 |
type="pil",
|
31 |
label="Upload an Image",
|
32 |
interactive=True,
|
33 |
+
value=None, # Default value set to None
|
34 |
),
|
35 |
gr.CheckboxGroup(
|
36 |
choices=["yolov5", "yolov8s"],
|
|
|
47 |
[os.path.join(os.getcwd(), "data/xai/sample2.jpg")],
|
48 |
],
|
49 |
live=True,
|
|
|
50 |
)
|
51 |
|
52 |
+
# Override the input image function to provide fallback
|
53 |
+
interface.inputs[0].update(value=None)
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
|
56 |
if __name__ == "__main__":
|