Guillermo Uribe Vicencio commited on
Commit
65d3323
·
1 Parent(s): 637e7be
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -57,7 +57,7 @@ cdl_color_map = [{'value': 1, 'label': 'Natural vegetation', 'rgb': (233,255,190
57
  {'value': 12, 'label': 'Sorghum', 'rgb':(255,158,15), 'qtt': 0},
58
  {'value': 13, 'label': 'Other', 'rgb':(0,175,77), 'qtt': 0}]
59
 
60
- def apply_color_map(rgb, color_map, map_resume):
61
 
62
  rgb_mapped = rgb.copy()
63
 
@@ -271,15 +271,16 @@ with gr.Blocks() as demo:
271
  inp3=gr.Image(image_mode='RGB', scale=10, label='T3')
272
 
273
  with gr.Row():
274
- with gr.Column():
275
- gr.BarPlot(bar_data,
276
- x="label",
277
- y="qtt",
278
- title="Simple Bar Plot with made up data",
279
- tooltip=["label", "qtt"])
280
- gr.LinePlot(bar_data,
281
- x='label',
282
- y='qtt')
 
283
  with gr.Column():
284
  out = gr.Image(image_mode='RGB', scale=10, label='Model prediction')
285
  # gr.Image(value='Legend.png', image_mode='RGB', scale=2, show_label=False)
 
57
  {'value': 12, 'label': 'Sorghum', 'rgb':(255,158,15), 'qtt': 0},
58
  {'value': 13, 'label': 'Other', 'rgb':(0,175,77), 'qtt': 0}]
59
 
60
+ def apply_color_map(rgb, color_map=cdl_color_map, map_resume=map_resume):
61
 
62
  rgb_mapped = rgb.copy()
63
 
 
271
  inp3=gr.Image(image_mode='RGB', scale=10, label='T3')
272
 
273
  with gr.Row():
274
+ if len(map_resume) > 1:
275
+ with gr.Column():
276
+ gr.BarPlot(bar_data,
277
+ x="label",
278
+ y="qtt",
279
+ title="Simple Bar Plot with made up data",
280
+ tooltip=["label", "qtt"])
281
+ gr.LinePlot(bar_data,
282
+ x='label',
283
+ y='qtt')
284
  with gr.Column():
285
  out = gr.Image(image_mode='RGB', scale=10, label='Model prediction')
286
  # gr.Image(value='Legend.png', image_mode='RGB', scale=2, show_label=False)