File size: 778 Bytes
a1ee05b
 
 
cee1db4
 
 
 
 
 
 
 
a1ee05b
 
 
 
 
ce867e1
a1ee05b
 
 
c422c3b
cee1db4
a1ee05b
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
from classification import classify_image

# List of example images
examples = [
    ["grass1.png"],
    ["grass2.png"],
    ["wood1.png"],
    ["wood2.png"]
]

# Create a Gradio interface with a dropdown menu for algorithm selection
iface = gr.Interface(
    fn=classify_image, 
    inputs=[
        gr.Image(type='numpy', label="Upload an Image"),
        gr.Dropdown(choices=['GLCM', 'LBP'], label="Algorithm", value='GLCM'),
    ],
    outputs='text',
    title='Texture Classification',
    description='Upload an image and choose an algorithm (GLCM or LBP) for texture classification. Or select an example image from the dropdown menu.',
    examples=examples  # Add examples directly to the interface
)

# Launch the interface
iface.launch(share=True)