Paolo-Fraccaro
commited on
Commit
•
ba77978
1
Parent(s):
9a22322
add examples
Browse files
app.py
CHANGED
@@ -379,6 +379,12 @@ def predict_on_images(data_files: list, mask_ratio: float, yaml_file_path: str,
|
|
379 |
|
380 |
func = partial(predict_on_images, yaml_file_path=yaml_file_path,checkpoint=checkpoint)
|
381 |
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
|
383 |
with gr.Blocks() as demo:
|
384 |
|
@@ -431,5 +437,20 @@ with gr.Blocks() as demo:
|
|
431 |
out7_pred_t1,
|
432 |
out8_pred_t2,
|
433 |
out9_pred_t3])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
|
435 |
demo.launch()
|
|
|
379 |
|
380 |
func = partial(predict_on_images, yaml_file_path=yaml_file_path,checkpoint=checkpoint)
|
381 |
|
382 |
+
def preprocess_example(example_list):
|
383 |
+
|
384 |
+
example_list = [os.path.join(os.path.abspath(''), x) for x in example_list]
|
385 |
+
|
386 |
+
return example_list
|
387 |
+
|
388 |
|
389 |
with gr.Blocks() as demo:
|
390 |
|
|
|
437 |
out7_pred_t1,
|
438 |
out8_pred_t2,
|
439 |
out9_pred_t3])
|
440 |
+
with gr.Row():
|
441 |
+
gr.Markdown("##Examples")
|
442 |
+
gr.Examples([["HLS.L30.T13REN.2018013T172747.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif",
|
443 |
+
"HLS.L30.T13REN.2018029T172738.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif",
|
444 |
+
"HLS.L30.T13REN.2018061T172724.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif"],
|
445 |
+
["HLS.L30.T17RMP.2018004T155509.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif",
|
446 |
+
"HLS.L30.T17RMP.2018036T155452.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif",
|
447 |
+
"HLS.L30.T17RMP.2018068T155438.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif"],
|
448 |
+
["HLS.L30.T18TVL.2018029T154533.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif",
|
449 |
+
"HLS.L30.T18TVL.2018141T154435.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif",
|
450 |
+
"HLS.L30.T18TVL.2018189T154446.v2.0.B02.B03.B04.B05.B06.B07_cropped.tif"]],
|
451 |
+
preprocess=preprocess_example
|
452 |
+
cache_examples=True,
|
453 |
+
)
|
454 |
+
|
455 |
|
456 |
demo.launch()
|