Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,7 +57,7 @@ def generate_images(canvas,output_type):
|
|
| 57 |
input_img = get_canny_filter(input_img) if output_type == "Canny" else input_img
|
| 58 |
input_img = ImageOps.invert(input_img)
|
| 59 |
input_img.save("tmp.png")
|
| 60 |
-
return "tmp.png"
|
| 61 |
def placeholder_fn(axis):
|
| 62 |
pass
|
| 63 |
with gr.Blocks() as b:
|
|
@@ -68,6 +68,7 @@ with gr.Blocks() as b:
|
|
| 68 |
pose_template = gr.Radio(choices=["regular", "ballet", "handstand", "split", "kick", "chilling"], value="regular", label="Pose template")
|
| 69 |
output_type = gr.Radio(choices=["Depth", "Canny"], value="Depth", label="Image Output")
|
| 70 |
run_button = gr.Button("Generate")
|
|
|
|
| 71 |
out_im = gr.Image(type='filepath',show_share_button=True)
|
| 72 |
|
| 73 |
rotation_axis.change(fn=placeholder_fn,
|
|
@@ -82,7 +83,7 @@ with gr.Blocks() as b:
|
|
| 82 |
_js=js_pose_template)
|
| 83 |
run_button.click(fn=generate_images,
|
| 84 |
inputs=[canvas,output_type],
|
| 85 |
-
outputs=[out_im],
|
| 86 |
_js=get_js_image)
|
| 87 |
b.load(None,None,None,_js=load_js)
|
| 88 |
|
|
|
|
| 57 |
input_img = get_canny_filter(input_img) if output_type == "Canny" else input_img
|
| 58 |
input_img = ImageOps.invert(input_img)
|
| 59 |
input_img.save("tmp.png")
|
| 60 |
+
return "tmp.png","tmp.png"
|
| 61 |
def placeholder_fn(axis):
|
| 62 |
pass
|
| 63 |
with gr.Blocks() as b:
|
|
|
|
| 68 |
pose_template = gr.Radio(choices=["regular", "ballet", "handstand", "split", "kick", "chilling"], value="regular", label="Pose template")
|
| 69 |
output_type = gr.Radio(choices=["Depth", "Canny"], value="Depth", label="Image Output")
|
| 70 |
run_button = gr.Button("Generate")
|
| 71 |
+
out_file=gr.File()
|
| 72 |
out_im = gr.Image(type='filepath',show_share_button=True)
|
| 73 |
|
| 74 |
rotation_axis.change(fn=placeholder_fn,
|
|
|
|
| 83 |
_js=js_pose_template)
|
| 84 |
run_button.click(fn=generate_images,
|
| 85 |
inputs=[canvas,output_type],
|
| 86 |
+
outputs=[out_im,out_file],
|
| 87 |
_js=get_js_image)
|
| 88 |
b.load(None,None,None,_js=load_js)
|
| 89 |
|