Genis commited on
Commit
10bc237
·
verified ·
1 Parent(s): 54655ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -94,7 +94,7 @@ def fit_model(zip_file_path):
94
 
95
  def predict(image):
96
  l = m.predict(image)
97
- return f'Predicted Class: {l}'
98
 
99
 
100
  def export(password):
@@ -112,18 +112,18 @@ with gr.Blocks() as demo:
112
 
113
  with gr.Row() as g1:
114
  inp = gr.File(label="zip file")
115
- out = gr.Textbox()
116
  btn = gr.Button("Submit Zip File")
117
  btn.click(fn=fit_model, inputs=inp, outputs=out)
118
 
119
  with gr.Row() as g2:
120
  inp2 = gr.Image(label="Input Image", type='pil')
121
- out2 = gr.Textbox()
122
  btn2 = gr.Button("Predict/Test on an Image")
123
  btn2.click(fn=predict, inputs=inp2, outputs=out2)
124
 
125
  with gr.Row() as g3:
126
- inp3 = gr.Textbox()
127
  out3 = gr.File(label='Download link', visible=True, height=30, interactive=False)
128
  out4 = gr.File(label='Download link', visible=True, height=30, interactive=False)
129
  out5 = gr.File(label='Download link', visible=True, height=30, interactive=False)
 
94
 
95
  def predict(image):
96
  l = m.predict(image)
97
+ return f'Predicted Class: {l[0]}'
98
 
99
 
100
  def export(password):
 
112
 
113
  with gr.Row() as g1:
114
  inp = gr.File(label="zip file")
115
+ out = gr.Textbox(label='Message')
116
  btn = gr.Button("Submit Zip File")
117
  btn.click(fn=fit_model, inputs=inp, outputs=out)
118
 
119
  with gr.Row() as g2:
120
  inp2 = gr.Image(label="Input Image", type='pil')
121
+ out2 = gr.Textbox(label='Prediction')
122
  btn2 = gr.Button("Predict/Test on an Image")
123
  btn2.click(fn=predict, inputs=inp2, outputs=out2)
124
 
125
  with gr.Row() as g3:
126
+ inp3 = gr.Textbox(label='Password to Download')
127
  out3 = gr.File(label='Download link', visible=True, height=30, interactive=False)
128
  out4 = gr.File(label='Download link', visible=True, height=30, interactive=False)
129
  out5 = gr.File(label='Download link', visible=True, height=30, interactive=False)