Spaces:
Sleeping
Sleeping
File size: 1,798 Bytes
42fa7ec ec42e29 42fa7ec 14e27af efdf1b4 14e27af 42fa7ec ec42e29 14e27af ec42e29 14e27af ec42e29 f8dbcd9 14e27af 761b08f 14e27af 42fa7ec 14e27af |
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import gradio as gr
from PIL import Image
from backend import Infer
DEBUG = True
infer = Infer(DEBUG)
with gr.Blocks(analytics_enabled=False, title="DeepNAPSI") as demo:
with gr.Column():
gr.Markdown("## Welcome to the DeepNAPSI application!")
gr.Markdown("Upload an image of the one hand and click **Predict NAPSI** to see the output.\n" \
"> Note: Make sure there are no identifying information present in the image. The prediction can take up to 1 minute.")
with gr.Column():
with gr.Row():
image_input = gr.Image()
example_images = gr.Examples(["assets/example_1.jpg", "assets/example_2.jpg", "assets/example_3.jpg"], image_input)
with gr.Row():
image_button = gr.Button("Predict NAPSI")
outputs = []
with gr.Row():
outputs.append(gr.Number(label="DeepNAPSI Sum"))
with gr.Column():
outputs.append(gr.Image())
outputs.append(gr.Number(label="DeepNAPSI Thumb"))
with gr.Column():
outputs.append(gr.Image())
outputs.append(gr.Number(label="DeepNAPSI Index"))
with gr.Column():
outputs.append(gr.Image())
outputs.append(gr.Number(label="DeepNAPSI Middle"))
with gr.Column():
outputs.append(gr.Image())
outputs.append(gr.Number(label="DeepNAPSI Ring"))
with gr.Column():
outputs.append(gr.Image())
outputs.append(gr.Number(label="DeepNAPSI Pinky"))
image_button.click(infer.predict, inputs=image_input, outputs=outputs)
demo.launch(share=True)
|