Spaces:
Sleeping
Sleeping
File size: 875 Bytes
05f2464 cce947a 05f2464 e92ae0e 05f2464 e92ae0e 05f2464 ce5f33e 05f2464 2839409 05f2464 |
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 27 28 |
import gradio as gr
from const import examples
from imageProcessor import ImageProcessor
# Create an instance of the ImageProcessor class
processor = ImageProcessor()
# Create Gradio interface
demo = gr.Interface(
fn=processor.process_image,
inputs=[
gr.Image(type="pil", label="Upload an Image"),
gr.Slider(8, 32, step=4, value=8, label="Output Tile Size (e.g., 16x16)"),
gr.Radio(choices=["Robots","Cats", "Humans"], label="Tile Type" ,value="Robots"),
],
outputs=[
gr.Image(type="pil", label="Processed Image with Grid Analysis"),
gr.Textbox(label="Metrics Explanation")
],
title="Image Grid Analysis",
description="Upload an image and divide it into grids to analyze color or intensity data in each cell.",
examples=examples
)
# Run the app
if __name__ == "__main__":
demo.launch()
|