Siyun He commited on
Commit
cee1db4
·
1 Parent(s): b262a00

update gradio interface

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -2,6 +2,14 @@ import gradio as gr
2
  from classification import classify_image
3
  import pickle
4
 
 
 
 
 
 
 
 
 
5
  # Create a Gradio interface with a dropdown menu for algorithm selection
6
  iface = gr.Interface(
7
  fn=classify_image,
@@ -12,6 +20,7 @@ iface = gr.Interface(
12
  outputs='text',
13
  title='Texture Classification',
14
  description='Upload an image and choose an algorithm (GLCM or LBP) for texture classification.'
 
15
  )
16
 
17
  # Launch the interface
 
2
  from classification import classify_image
3
  import pickle
4
 
5
+ # List of example images
6
+ examples = [
7
+ ["grass1.png"],
8
+ ["grass2.png"],
9
+ ["wood1.png"],
10
+ ["wood2.png"]
11
+ ]
12
+
13
  # Create a Gradio interface with a dropdown menu for algorithm selection
14
  iface = gr.Interface(
15
  fn=classify_image,
 
20
  outputs='text',
21
  title='Texture Classification',
22
  description='Upload an image and choose an algorithm (GLCM or LBP) for texture classification.'
23
+ examples=examples # Add examples directly to the interface
24
  )
25
 
26
  # Launch the interface