Masaaki Kawata
commited on
Commit
Β·
75bd3a8
1
Parent(s):
703765f
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,8 +76,8 @@ def generate_parallax(image: np.ndarray, n: int):
|
|
| 76 |
|
| 77 |
|
| 78 |
@spaces.GPU
|
| 79 |
-
def generate_animation(image: np.ndarray
|
| 80 |
-
return generate_animation_images(Image.fromarray(image, 'RGBA')
|
| 81 |
|
| 82 |
|
| 83 |
with gr.Blocks(theme=Theme()) as demo:
|
|
@@ -98,13 +98,12 @@ with gr.Blocks(theme=Theme()) as demo:
|
|
| 98 |
with gr.Row():
|
| 99 |
with gr.Column():
|
| 100 |
animation_input_image = gr.Image(image_mode='RGBA', label='Input')
|
| 101 |
-
animation_input_frame = gr.Number(value=-1, precision=0, minimum=-1, maximum=1, step=1, label='Frame')
|
| 102 |
animation_generate_button = gr.Button('Generate')
|
| 103 |
with gr.Column():
|
| 104 |
animation_output_gallery = gr.Gallery(label='Outputs', columns=5)
|
| 105 |
|
| 106 |
parallax_generate_button.click(fn=generate_parallax, inputs=[parallax_input_image, parallax_input_layers], outputs=[parallax_output_gallery, parallax_output_json, parallax_output_nsfw], api_name='generate_parallax')
|
| 107 |
-
animation_generate_button.click(fn=generate_animation, inputs=
|
| 108 |
|
| 109 |
|
| 110 |
if __name__ == '__main__':
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
@spaces.GPU
|
| 79 |
+
def generate_animation(image: np.ndarray):
|
| 80 |
+
return generate_animation_images(Image.fromarray(image, 'RGBA'))
|
| 81 |
|
| 82 |
|
| 83 |
with gr.Blocks(theme=Theme()) as demo:
|
|
|
|
| 98 |
with gr.Row():
|
| 99 |
with gr.Column():
|
| 100 |
animation_input_image = gr.Image(image_mode='RGBA', label='Input')
|
|
|
|
| 101 |
animation_generate_button = gr.Button('Generate')
|
| 102 |
with gr.Column():
|
| 103 |
animation_output_gallery = gr.Gallery(label='Outputs', columns=5)
|
| 104 |
|
| 105 |
parallax_generate_button.click(fn=generate_parallax, inputs=[parallax_input_image, parallax_input_layers], outputs=[parallax_output_gallery, parallax_output_json, parallax_output_nsfw], api_name='generate_parallax')
|
| 106 |
+
animation_generate_button.click(fn=generate_animation, inputs=animation_input_image, outputs=animation_output_gallery, api_name='generate_animation')
|
| 107 |
|
| 108 |
|
| 109 |
if __name__ == '__main__':
|