from src.generate import gerar_imagem
import gradio as gr
with gr.Blocks(title="Digit Generator", css="footer{display:none !important}") as demo:
gr.HTML("""
GenDigit
""")
with gr.Row():
with gr.Column():
input_number = gr.Number(minimum=0, maximum=9, label="Enter a number between 0 and 9")
input_button = gr.Button("Generate")
with gr.Column():
with gr.Row():
output_images_1 = [
gr.Image(show_label=False, show_download_button=False, show_fullscreen_button=False, show_share_button=False),
gr.Image(show_label=False, show_download_button=False, show_fullscreen_button=False, show_share_button=False),
gr.Image(show_label=False, show_download_button=False, show_fullscreen_button=False, show_share_button=False),
]
with gr.Row():
output_images_2 = [
gr.Image(show_label=False, show_download_button=False, show_fullscreen_button=False, show_share_button=False),
gr.Image(show_label=False, show_download_button=False, show_fullscreen_button=False, show_share_button=False),
gr.Image(show_label=False, show_download_button=False, show_fullscreen_button=False, show_share_button=False),
]
input_button.click(fn=gerar_imagem, inputs=[input_number], outputs=output_images_1+output_images_2)
with gr.Accordion(open=False, label="About"):
with open("README.md", "r") as readme_file:
gr.Markdown(
readme_file.read()
)
demo.launch()