Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
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 |
-
|
|
|
|
| 161 |
conditioning_image = generate_edgeImage(image_path)
|
| 162 |
-
elif input_choice ==
|
| 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 ==
|
| 171 |
pipe = pipe_edge
|
| 172 |
-
elif input_choice ==
|
| 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(
|