File size: 2,645 Bytes
d47fa16 |
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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
import gradio as gr
import pandas as pd
import tsai
import Generate
example_df_aircomp=pd.read_csv('D:/project/aircompressordata.csv')
example_df_ener=pd.read_csv('D:/project/energymeter.csv')
example_df_boiler=pd.read_csv('D:/project/Boiler1.csv')
demo=gr.Blocks(title="EcoForecast")
def pred_air(date):
preds=Generate.inference_Aircomp(date,example_df_aircomp)
return preds
def pred_ener(date):
preds=Generate.inference_Energy(date,example_df_ener)
return preds
def pred_boiler(date):
preds=Generate.inference_boiler(date,example_df_boiler)
return preds
def plotgraphs(dataframe):
plots=0
return plots
with demo:
gr.Markdown("Tool for predicting the next seven days of data in the future using the last 200 points of data incoming")
with gr.Tabs():
with gr.TabItem("Air compressor data"):
with gr.Row():
Air_input=gr.Text(placeholder="Enter date and like the example only",show_label=False)
air_dataframe_input=gr.Dataframe(example_df_aircomp.head(100))
Air_dataframe_output=gr.Dataframe()
Air_plots=gr.Plot()
with gr.Column():
Aircomp_output_btn=gr.Button("Forecast")
Air_plot_forecast=gr.Button("Plot")
with gr.TabItem("Energymeter data"):
with gr.Row():
ener_input=gr.Text(placeholder="Enter the date and time in example format only",show_label=False)
ener_dataframe_input=gr.Dataframe(example_df_ener.head(100))
Ener_dataframe_output=gr.Dataframe()
Ener_plots=gr.Plot()
with gr.Column():
Energy_output_btn=gr.Button("Forecast")
Ener_plot_forecast=gr.Button("Plot")
with gr.TabItem("Boiler data"):
with gr.Row():
boiler_input=gr.Text(placeholder="Enter the date and time in example format only",show_label=False)
ener_dataframe_input=gr.Dataframe(example_df_boiler.head(100))
boiler_dataframe_output=gr.Dataframe()
boil_plots=gr.Plot()
with gr.Column():
Boiler_output_btn=gr.Button("Forecast")
boiler_plot_forecast=gr.Button("Plot")
Aircomp_output_btn.click(pred_air,inputs=Air_input,outputs=Air_dataframe_output)
Energy_output_btn.click(pred_ener,inputs=ener_input,outputs=Ener_dataframe_output)
Boiler_output_btn.click(pred_boiler,inputs=boiler_input,outputs=boiler_dataframe_output)
Air_plot_forecast.click()
demo.launch(share=True) |