Spaces:
Build error
Build error
File size: 1,683 Bytes
a5bd089 |
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 |
import gradio as gr
from funcs.processor import process_data
from funcs.plot_func import plot_sensor_data_from_json
filename= 'Data/data/canter/normal/don/20220222-114107-Don-canter right 25steps.txt'
with gr.Blocks(title='Cabasus') as cabasus_sensor:
title = gr.Markdown("<h2><center>Data gathering and processing</center></h2>")
with gr.Tab("Convert"):
csv_file_box = gr.File(label='Upload CSV File')
with gr.Row():
processed_file_box = gr.File(label='Processed CSV File')
json_file_box = gr.File(label='Generated Json file')
with gr.Row():
window_size_slider = gr.inputs.Slider(16, 512, 1, 64, label="Slice Size")
sample_rate = gr.inputs.Slider(1, 199, 1, 20, label="Sample rate")
with gr.Row():
leg_dropdown = gr.Dropdown(choices=['GZ1', 'GZ2', 'GZ3', 'GZ4'], label='select leg', value='GZ1')
with gr.Row():
plot_box_leg = gr.Plot(label="Filtered Signal Plot")
plot_box_overlay = gr.Plot(label="Overlay Signal Plot")
slices_per_leg = gr.Textbox(label="Number of slices found per LEG")
try:
example = gr.Examples(examples=filename, inputs=[csv_file_box])
except:
pass
csv_file_box.change(process_data, inputs=[csv_file_box, window_size_slider, sample_rate], outputs=[processed_file_box, json_file_box, slices_per_leg, plot_box_leg, plot_box_overlay])
leg_dropdown.change(plot_sensor_data_from_json, inputs=[json_file_box, leg_dropdown], outputs=[plot_box_leg])
cabasus_sensor.queue(concurrency_count=2).launch(debug=True) |