Spaces:
Runtime error
Runtime error
Fix example button: run prediction directly instead of populating inputs
Browse files248 unmodified lines249250251252253252253254255256255256257258259259260261261262263264265248 unmodified lines
# Example section if os.path.exists(EXAMPLE_FILE): gr.Markdown("---\n**No GeoTIFF handy?** Click below to try an example tile from Danum Valley, Borneo.") example_btn = gr.Button("Load example tile", variant="secondary") gr.Markdown("---\n**No GeoTIFF handy?** Click below to run detectree2 on an example tile from Danum Valley, Borneo.") example_btn = gr.Button("▶ Run example", variant="secondary")
def load_example(): return EXAMPLE_FILE, "Flexible", 0.3 def run_example(): return run_detectree2(EXAMPLE_FILE, "Flexible", 0.3)
example_btn.click( load_example, run_example, inputs=[], outputs=[inp_file, env_dd, conf], outputs=[out_img, out_gpkg, out_stats, out_err], concurrency_limit=1, )
# Manage Weights tab (hidden unless admin env var is set)app.py+7-6