Guillermo Uribe Vicencio commited on
Commit
ed84002
·
1 Parent(s): c6ddbf2
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -215,8 +215,11 @@ def inference_on_file(target_image, model, custom_test_pipeline, map_resume):
215
 
216
 
217
  output=apply_color_map(output,map_resume).transpose((1,2,0))
218
-
219
- return rgb1,rgb2,rgb3,output
 
 
 
220
 
221
  def process_test_pipeline(custom_test_pipeline, bands=None):
222
 
@@ -247,9 +250,6 @@ custom_test_pipeline=process_test_pipeline(model.cfg.data.test.pipeline, None)
247
 
248
  func = partial(inference_on_file, model=model, custom_test_pipeline=custom_test_pipeline, map_resume=map_resume)
249
 
250
- bar_data = pd.DataFrame(map_resume)
251
- print("map_resume", map_resume)
252
- print("bar_data", bar_data)
253
 
254
  with gr.Blocks() as demo:
255
  with gr.Row():
@@ -286,7 +286,7 @@ with gr.Blocks() as demo:
286
  out = gr.Image(image_mode='RGB', scale=10, label='Model prediction')
287
  # gr.Image(value='Legend.png', image_mode='RGB', scale=2, show_label=False)
288
 
289
- btn.click(fn=func, inputs=inp, outputs=[inp1, inp2, inp3, out])
290
 
291
  with gr.Row():
292
  gr.Markdown(value='### Model prediction legend')
 
215
 
216
 
217
  output=apply_color_map(output,map_resume).transpose((1,2,0))
218
+ bar_data = pd.DataFrame(map_resume)
219
+ print("map_resume", map_resume)
220
+ print("bar_data", bar_data)
221
+
222
+ return rgb1,rgb2,rgb3,output,bar_data
223
 
224
  def process_test_pipeline(custom_test_pipeline, bands=None):
225
 
 
250
 
251
  func = partial(inference_on_file, model=model, custom_test_pipeline=custom_test_pipeline, map_resume=map_resume)
252
 
 
 
 
253
 
254
  with gr.Blocks() as demo:
255
  with gr.Row():
 
286
  out = gr.Image(image_mode='RGB', scale=10, label='Model prediction')
287
  # gr.Image(value='Legend.png', image_mode='RGB', scale=2, show_label=False)
288
 
289
+ btn.click(fn=func, inputs=inp, outputs=[inp1, inp2, inp3, out,bar_data])
290
 
291
  with gr.Row():
292
  gr.Markdown(value='### Model prediction legend')