Spaces:
Sleeping
Sleeping
Fixing outputs overlapping each other
Browse files
app.py
CHANGED
|
@@ -67,12 +67,19 @@ css = """.my-group {max-width: 500px !important; max-height: 500px !important;}
|
|
| 67 |
.my-column {display: flex !important; justify-content: center !important; align-items: center !important};"""
|
| 68 |
|
| 69 |
with gr.Blocks(css=css) as demo:
|
| 70 |
-
with gr.
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
input_img = gr.Image(sources=["webcam"], type="numpy", streaming=True, label="Webcam Input")
|
|
|
|
| 73 |
output_label = gr.Label(label="Predicted ASL Sign")
|
| 74 |
output_plot = gr.Plot(label="Class Probabilities")
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
demo.launch()
|
|
|
|
| 67 |
.my-column {display: flex !important; justify-content: center !important; align-items: center !important};"""
|
| 68 |
|
| 69 |
with gr.Blocks(css=css) as demo:
|
| 70 |
+
with gr.Row():
|
| 71 |
+
gr.Markdown("# ASL Recognition App")
|
| 72 |
+
with gr.Row():
|
| 73 |
+
with gr.Column(scale=1):
|
| 74 |
input_img = gr.Image(sources=["webcam"], type="numpy", streaming=True, label="Webcam Input")
|
| 75 |
+
with gr.Column(scale=1):
|
| 76 |
output_label = gr.Label(label="Predicted ASL Sign")
|
| 77 |
output_plot = gr.Plot(label="Class Probabilities")
|
| 78 |
|
| 79 |
+
def gradio_pipeline(frame):
|
| 80 |
+
predicted_label, fig = predict_asl(frame)
|
| 81 |
+
return predicted_label, fig
|
| 82 |
+
|
| 83 |
+
input_img.stream(gradio_pipeline, [input_img], [output_label, output_plot], time_limit=30, stream_every=0.1)
|
| 84 |
|
| 85 |
demo.launch()
|