Commit
·
c099822
1
Parent(s):
a2fbfcf
forgot comma
Browse files
app.py
CHANGED
|
@@ -74,6 +74,11 @@ def get_meta(fname):
|
|
| 74 |
|
| 75 |
return meta
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
|
| 79 |
def inference_segmentor(model, imgs, custom_test_pipeline=None):
|
|
@@ -195,5 +200,17 @@ with gr.Blocks() as demo:
|
|
| 195 |
out2 = gr.Image(image_mode='L')
|
| 196 |
|
| 197 |
btn.click(fn=func, inputs=inp, outputs=[out1, out2])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
demo.launch()
|
|
|
|
| 74 |
|
| 75 |
return meta
|
| 76 |
|
| 77 |
+
def preprocess_example(example_list):
|
| 78 |
+
|
| 79 |
+
example_list = [os.path.join(os.path.abspath(''), x) for x in example_list]
|
| 80 |
+
|
| 81 |
+
return example_list
|
| 82 |
|
| 83 |
|
| 84 |
def inference_segmentor(model, imgs, custom_test_pipeline=None):
|
|
|
|
| 200 |
out2 = gr.Image(image_mode='L')
|
| 201 |
|
| 202 |
btn.click(fn=func, inputs=inp, outputs=[out1, out2])
|
| 203 |
+
|
| 204 |
+
with gr.Row():
|
| 205 |
+
gr.Markdown("##Examples")
|
| 206 |
+
gr.Examples(examples=["subsetted_512x512_HLS.S30.T10TGS.2020245.v1.4_merged.tif",
|
| 207 |
+
"subsetted_512x512_HLS.S30.T10UGU.2021249.v1.4_merged.tif",
|
| 208 |
+
"subsetted_512x512_HLS.S30.T10UGV.2020218.v1.4_merged.tif"],
|
| 209 |
+
inputs=inp,
|
| 210 |
+
outputs=[out1, out2],
|
| 211 |
+
preprocess=preprocess_example,
|
| 212 |
+
fn=func,
|
| 213 |
+
cache_examples=True,
|
| 214 |
+
)
|
| 215 |
|
| 216 |
demo.launch()
|