Nunzio commited on
Commit
c1389a6
·
1 Parent(s): c8e426d

fixed order

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -12,6 +12,9 @@ city_image_dir = "./preloadedImages/cityScapes"
12
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
13
 
14
 
 
 
 
15
 
16
  # %% prediction on an image
17
 
@@ -84,6 +87,9 @@ with gr.Blocks(title="Semantic Segmentation Predictors") as demo:
84
  rows=1, height=256, type="pil"
85
  )
86
 
 
 
 
87
  submit_btn.click(
88
  fn=run_prediction,
89
  inputs=[image_input, model_selector],
@@ -92,13 +98,6 @@ with gr.Blocks(title="Semantic Segmentation Predictors") as demo:
92
 
93
  gr.Markdown("Made by group 21 semantic segmentation project. ")
94
 
95
- def load_example(example_img):
96
- return gr.update(value=example_img)
97
-
98
- # On click: update image_input with selected example
99
- gta_gallery.select(fn=load_example, inputs=[gta_gallery], outputs=[image_input])
100
- city_gallery.select(fn=load_example, inputs=[city_gallery], outputs=[image_input])
101
-
102
  demo.launch()
103
 
104
 
 
12
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
13
 
14
 
15
+ def load_example(example_img):
16
+ return gr.update(value=example_img)
17
+
18
 
19
  # %% prediction on an image
20
 
 
87
  rows=1, height=256, type="pil"
88
  )
89
 
90
+ gta_gallery.select(fn=load_example, inputs=[gta_gallery], outputs=[image_input])
91
+ city_gallery.select(fn=load_example, inputs=[city_gallery], outputs=[image_input])
92
+
93
  submit_btn.click(
94
  fn=run_prediction,
95
  inputs=[image_input, model_selector],
 
98
 
99
  gr.Markdown("Made by group 21 semantic segmentation project. ")
100
 
 
 
 
 
 
 
 
101
  demo.launch()
102
 
103