Spaces:
Sleeping
Sleeping
File size: 1,120 Bytes
350b651 a7a48b8 e99a146 6dc79d9 e99a146 a7a48b8 e99a146 6dc79d9 d7579e3 5ec701f a37501a e99a146 171ed6b 4bebe44 a62013c 4bebe44 171ed6b 312464a 3d3efa4 |
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 44 45 |
import numpy as np
import gradio as gr
from model import api
from PIL import Image
sign_api = api()
def sign(input_img):
input_img = Image.fromarray(input_img)
prediction = sign_api.predict(input_img)
print('prediction',prediction)
return prediction['class']
css = ''
# with gr.Blocks(css=css) as demo:
# gr.HTML("<h1><center>Signsapp: Classify the signs based on the hands sign images<center><h1>")
# gr.Interface(sign,inputs=gr.Image(shape=(200, 200)), outputs=gr.Label())
title = r"Signsapp"
description = r"""
<center>
Classify the signs based on the hands sign images
<img src="images/SIGNS.png" width=200px>
</center>
"""
article = r"""
- [Coursera](https://arxiv.org/pdf/1512.03385)
"""
demo = gr.Interface(
title = title,
description = description,
article = article,
fn=sign,
inputs = gr.Image(shape=(200, 200)),
outputs = gr.Label(),
# allow_flagging = "manual",
# flagging_options = ['recule', 'tournedroite', 'arretetoi', 'tournegauche', 'gauche', 'avance', 'droite'],
# flagging_dir = "./flag/men"
)
# demo.queue()
demo.launch(debug=True)
|