Siyun He
update gradio interface
c422c3b
raw
history blame contribute delete
778 Bytes
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)