Spaces:
Runtime error
Runtime error
Guillermo Uribe Vicencio
commited on
Commit
·
e90ef37
1
Parent(s):
a9f3255
app.py
CHANGED
|
@@ -180,7 +180,7 @@ def process_rgb(input, mask, indexes):
|
|
| 180 |
|
| 181 |
return rgb
|
| 182 |
|
| 183 |
-
def inference_on_file(target_image, model, custom_test_pipeline,
|
| 184 |
|
| 185 |
target_image = target_image.name
|
| 186 |
time_taken=-1
|
|
@@ -216,10 +216,7 @@ def inference_on_file(target_image, model, custom_test_pipeline, bar_data):
|
|
| 216 |
|
| 217 |
output=apply_color_map(output,map_resume).transpose((1,2,0))
|
| 218 |
bar_data = pd.DataFrame(map_resume)
|
| 219 |
-
|
| 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 |
|
|
@@ -249,8 +246,10 @@ custom_test_pipeline=process_test_pipeline(model.cfg.data.test.pipeline, None)
|
|
| 249 |
|
| 250 |
|
| 251 |
bar_data = pd.DataFrame(map_resume)
|
|
|
|
|
|
|
| 252 |
|
| 253 |
-
func = partial(inference_on_file, model=model, custom_test_pipeline=custom_test_pipeline,
|
| 254 |
|
| 255 |
|
| 256 |
with gr.Blocks() as demo:
|
|
@@ -288,7 +287,7 @@ with gr.Blocks() as demo:
|
|
| 288 |
out = gr.Image(image_mode='RGB', scale=10, label='Model prediction')
|
| 289 |
# gr.Image(value='Legend.png', image_mode='RGB', scale=2, show_label=False)
|
| 290 |
|
| 291 |
-
btn.click(fn=func, inputs=inp, outputs=[inp1, inp2, inp3, out
|
| 292 |
|
| 293 |
with gr.Row():
|
| 294 |
gr.Markdown(value='### Model prediction legend')
|
|
|
|
| 180 |
|
| 181 |
return rgb
|
| 182 |
|
| 183 |
+
def inference_on_file(target_image, model, custom_test_pipeline, map_resume):
|
| 184 |
|
| 185 |
target_image = target_image.name
|
| 186 |
time_taken=-1
|
|
|
|
| 216 |
|
| 217 |
output=apply_color_map(output,map_resume).transpose((1,2,0))
|
| 218 |
bar_data = pd.DataFrame(map_resume)
|
| 219 |
+
return rgb1,rgb2,rgb3,output
|
|
|
|
|
|
|
|
|
|
| 220 |
|
| 221 |
def process_test_pipeline(custom_test_pipeline, bands=None):
|
| 222 |
|
|
|
|
| 246 |
|
| 247 |
|
| 248 |
bar_data = pd.DataFrame(map_resume)
|
| 249 |
+
print("map_resume", map_resume)
|
| 250 |
+
print("bar_data", bar_data)
|
| 251 |
|
| 252 |
+
func = partial(inference_on_file, model=model, custom_test_pipeline=custom_test_pipeline, map_resume=map_resume)
|
| 253 |
|
| 254 |
|
| 255 |
with gr.Blocks() as demo:
|
|
|
|
| 287 |
out = gr.Image(image_mode='RGB', scale=10, label='Model prediction')
|
| 288 |
# gr.Image(value='Legend.png', image_mode='RGB', scale=2, show_label=False)
|
| 289 |
|
| 290 |
+
btn.click(fn=func, inputs=inp, outputs=[inp1, inp2, inp3, out])
|
| 291 |
|
| 292 |
with gr.Row():
|
| 293 |
gr.Markdown(value='### Model prediction legend')
|