know-one-1 commited on
Commit
d21e975
1 Parent(s): 8a78ad8

Live Display

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -119,16 +119,19 @@ with gr.Blocks() as demo:
119
 
120
  radio = gr.Radio(
121
  ["Canny", "Simple", "Sobel", "Laplacian"],
 
122
  label="Type of Edge Detector",
123
  )
 
 
124
  gr.Examples(examples, inputs=[image_input])
125
- image_output = gr.Image(shape=(256, 256))
126
 
127
  radio.change(
128
  fn=Detect,
129
  inputs=[image_input, radio],
130
  outputs=[kernel, order, direction, image_output],
131
  )
 
132
  kernel.change(
133
  fn=Detect_wo_layout,
134
  inputs=[image_input, radio, kernel, order, direction],
@@ -144,6 +147,10 @@ with gr.Blocks() as demo:
144
  inputs=[image_input, radio, kernel, order, direction],
145
  outputs=[image_output],
146
  )
147
-
 
 
 
 
148
 
149
  demo.launch()
 
119
 
120
  radio = gr.Radio(
121
  ["Canny", "Simple", "Sobel", "Laplacian"],
122
+ value="Canny",
123
  label="Type of Edge Detector",
124
  )
125
+ with gr.Column():
126
+ image_output = gr.Image(shape=(256, 256))
127
  gr.Examples(examples, inputs=[image_input])
 
128
 
129
  radio.change(
130
  fn=Detect,
131
  inputs=[image_input, radio],
132
  outputs=[kernel, order, direction, image_output],
133
  )
134
+
135
  kernel.change(
136
  fn=Detect_wo_layout,
137
  inputs=[image_input, radio, kernel, order, direction],
 
147
  inputs=[image_input, radio, kernel, order, direction],
148
  outputs=[image_output],
149
  )
150
+ image_input.change(
151
+ fn=Detect_wo_layout,
152
+ inputs=[image_input, radio, kernel, order, direction],
153
+ outputs=[image_output],
154
+ )
155
 
156
  demo.launch()