Add app.py and examples folder with images
Browse files
app.py
CHANGED
@@ -1,7 +1,20 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import glob
|
3 |
|
4 |
+
def classify_image(image):
|
5 |
+
# This function just returns "Not a bird" for any input image
|
6 |
+
return "Not a bird"
|
7 |
|
8 |
+
# Dynamically create the list of example images
|
9 |
+
example_files = glob.glob("examples/*.png")
|
10 |
+
examples = [[file] for file in example_files]
|
11 |
+
|
12 |
+
# Create the Gradio interface
|
13 |
+
demo = gr.Interface(
|
14 |
+
fn=classify_image, # The function to run
|
15 |
+
inputs="image", # The input type is an image
|
16 |
+
outputs="text", # The output type is text
|
17 |
+
examples=examples # Add example images
|
18 |
+
)
|
19 |
+
# Launch the app
|
20 |
demo.launch()
|
examples/Screen Shot 2024-06-11 at 10.22.19 PM.png
ADDED
![]() |
examples/Screen Shot 2024-06-11 at 10.22.49 PM.png
ADDED
![]() |
examples/Screen Shot 2024-06-11 at 10.23.11 PM.png
ADDED
![]() |
examples/Screen Shot 2024-06-11 at 10.25.30 PM.png
ADDED
![]() |
examples/Screen Shot 2024-06-11 at 10.27.17 PM.png
ADDED
![]() |