Spaces:
Running
on
Zero
Running
on
Zero
mikonvergence
commited on
Commit
·
e350327
1
Parent(s):
b3851ae
modality order bug fix
Browse files- app.py +2 -2
- src/backend.py +16 -5
app.py
CHANGED
@@ -7,7 +7,7 @@ theme = gr.themes.Soft(primary_hue="cyan", secondary_hue="zinc", font=[gr.themes
|
|
7 |
|
8 |
with gr.Blocks(theme=theme) as demo:
|
9 |
with gr.Column(elem_classes="header"):
|
10 |
-
gr.HTML('<img src="https://huggingface.co/spaces/mikonvergence/COP-GEN-Beta/resolve/main/logos/COP-GEN-logo.png" style="max-width: 300px;">')
|
11 |
gr.Markdown("# 🔵 COP-GEN-Beta: Unified Generative Modelling of COPernicus Imagery Thumbnails")
|
12 |
gr.Markdown("### Miguel Espinosa, Valerio Marsocci, Yuru Jia, Elliot J. Crowley, Mikolaj Czerkawski")
|
13 |
gr.HTML('<a href="https://github.com/miquel-espinosa/COP-GEN-Beta" class="text-decoration-none site-link"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/miquel-espinosa/COP-GEN-Beta"></a>')
|
@@ -83,4 +83,4 @@ with gr.Blocks(theme=theme) as demo:
|
|
83 |
s1rtc_reuse_button.click(fn=pass_value, inputs=[s1rtc_output],outputs=[s1rtc_input])
|
84 |
dem_reuse_button.click(fn=pass_value, inputs=[dem_output],outputs=[dem_input])
|
85 |
|
86 |
-
demo.queue().launch()
|
|
|
7 |
|
8 |
with gr.Blocks(theme=theme) as demo:
|
9 |
with gr.Column(elem_classes="header"):
|
10 |
+
gr.HTML('<img src="https://huggingface.co/spaces/mikonvergence/COP-GEN-Beta/resolve/main/logos/COP-GEN-logo.png" style="max-width: 90%; width:300px;">')
|
11 |
gr.Markdown("# 🔵 COP-GEN-Beta: Unified Generative Modelling of COPernicus Imagery Thumbnails")
|
12 |
gr.Markdown("### Miguel Espinosa, Valerio Marsocci, Yuru Jia, Elliot J. Crowley, Mikolaj Czerkawski")
|
13 |
gr.HTML('<a href="https://github.com/miquel-espinosa/COP-GEN-Beta" class="text-decoration-none site-link"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/miquel-espinosa/COP-GEN-Beta"></a>')
|
|
|
83 |
s1rtc_reuse_button.click(fn=pass_value, inputs=[s1rtc_output],outputs=[s1rtc_input])
|
84 |
dem_reuse_button.click(fn=pass_value, inputs=[dem_output],outputs=[dem_input])
|
85 |
|
86 |
+
demo.queue().launch(share=True)
|
src/backend.py
CHANGED
@@ -270,11 +270,22 @@ def generate_output(s2l1c_input, s2l2a_input, s1rtc_input, dem_input, num_infere
|
|
270 |
output = []
|
271 |
|
272 |
# Collect outputs
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
|
279 |
return output
|
280 |
|
|
|
270 |
output = []
|
271 |
|
272 |
# Collect outputs
|
273 |
+
if s2l1c_active:
|
274 |
+
output.append(s2l1c_input)
|
275 |
+
else:
|
276 |
+
output.append(to_PIL(imgs_out['s2_l1c'][0]))
|
277 |
+
if s2l2a_active:
|
278 |
+
output.append(s2l2a_input)
|
279 |
+
else:
|
280 |
+
output.append(to_PIL(imgs_out['s2_l2a'][0]))
|
281 |
+
if s1rtc_active:
|
282 |
+
output.append(s1rtc_input)
|
283 |
+
else:
|
284 |
+
output.append(to_PIL(imgs_out['s1_rtc'][0]))
|
285 |
+
if dem_active:
|
286 |
+
output.append(dem_input)
|
287 |
+
else:
|
288 |
+
output.append(to_PIL(imgs_out['dem'][0]))
|
289 |
|
290 |
return output
|
291 |
|