EmanHassan26 commited on
Commit
f2f5d76
·
verified ·
1 Parent(s): 21f3825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -157,9 +157,10 @@ def load_image(selected_file):
157
  def generate_input_image(image_path,input_choice):
158
  print(f"image_path: '{image_path}'")
159
  print(f"input_choice: '{input_choice}'")
160
- if input_choice == 0 :
 
161
  conditioning_image = generate_edgeImage(image_path)
162
- elif input_choice == 1 :
163
  conditioning_image = generate_segmt_img(image_path)
164
  else:
165
  conditioning_image = extract_depth_map(image_path)
@@ -167,9 +168,9 @@ def generate_input_image(image_path,input_choice):
167
 
168
  def generate_output_image(prompt,input_choice):
169
  #---------------------
170
- if input_choice == 0 :
171
  pipe = pipe_edge
172
- elif input_choice == 1 :
173
  pipe = pipe_seg
174
  else:
175
  pipe = pipe_depth
@@ -255,7 +256,7 @@ with gr.Blocks() as demo:
255
  #)
256
  generate_inp_btn.click(
257
  fn=generate_input_image,
258
- inputs=[file_input,image_dropdown],
259
  outputs=[input_preview]
260
  )
261
  generate_btn.click(
 
157
  def generate_input_image(image_path,input_choice):
158
  print(f"image_path: '{image_path}'")
159
  print(f"input_choice: '{input_choice}'")
160
+ # ["Edge image","Segmented image","Depth Image"]
161
+ if input_choice == "Edge image" :
162
  conditioning_image = generate_edgeImage(image_path)
163
+ elif input_choice == "Segmented image" :
164
  conditioning_image = generate_segmt_img(image_path)
165
  else:
166
  conditioning_image = extract_depth_map(image_path)
 
168
 
169
  def generate_output_image(prompt,input_choice):
170
  #---------------------
171
+ if input_choice == "Edge image":
172
  pipe = pipe_edge
173
+ elif input_choice == "Segmented image" :
174
  pipe = pipe_seg
175
  else:
176
  pipe = pipe_depth
 
256
  #)
257
  generate_inp_btn.click(
258
  fn=generate_input_image,
259
+ inputs=[file_input[0],image_dropdown],
260
  outputs=[input_preview]
261
  )
262
  generate_btn.click(