Spaces:
Runtime error
Runtime error
SerdarHelli
commited on
Commit
·
dcc2206
1
Parent(s):
62f8bf9
Update app.py
Browse files
app.py
CHANGED
@@ -98,7 +98,7 @@ def predict(Seed,choices):
|
|
98 |
grid.append(row)
|
99 |
|
100 |
# Render video.
|
101 |
-
video_out = imageio.get_writer(mp4, mode='I', fps=
|
102 |
for frame_idx in tqdm(range(num_keyframes * w_frames)):
|
103 |
imgs = []
|
104 |
for yi in range(grid_h):
|
@@ -109,7 +109,7 @@ def predict(Seed,choices):
|
|
109 |
imgs.append(img)
|
110 |
video_out.append_data(layout_grid(torch.stack(imgs), grid_w=grid_w, grid_h=grid_h))
|
111 |
video_out.close()
|
112 |
-
return
|
113 |
|
114 |
|
115 |
|
@@ -119,9 +119,8 @@ interface=gr.Interface(fn=predict, title="Brain MR Image Generation with StyleGA
|
|
119 |
article = "Author: S.Serdar Helli",
|
120 |
inputs=[gr.inputs.Slider( minimum=16, maximum=2**10,label='Seed'),gr.inputs.Radio( choices=choices, default='4x2',label='Image Grid')],
|
121 |
outputs=gr.outputs.Video(label='Video'),
|
122 |
-
live=False
|
123 |
-
flagging=False)
|
124 |
|
125 |
|
126 |
|
127 |
-
interface.launch(share=True)
|
|
|
98 |
grid.append(row)
|
99 |
|
100 |
# Render video.
|
101 |
+
video_out = imageio.get_writer(mp4, mode='I', fps=30, codec='libx264')
|
102 |
for frame_idx in tqdm(range(num_keyframes * w_frames)):
|
103 |
imgs = []
|
104 |
for yi in range(grid_h):
|
|
|
109 |
imgs.append(img)
|
110 |
video_out.append_data(layout_grid(torch.stack(imgs), grid_w=grid_w, grid_h=grid_h))
|
111 |
video_out.close()
|
112 |
+
return mp4
|
113 |
|
114 |
|
115 |
|
|
|
119 |
article = "Author: S.Serdar Helli",
|
120 |
inputs=[gr.inputs.Slider( minimum=16, maximum=2**10,label='Seed'),gr.inputs.Radio( choices=choices, default='4x2',label='Image Grid')],
|
121 |
outputs=gr.outputs.Video(label='Video'),
|
122 |
+
live=False)
|
|
|
123 |
|
124 |
|
125 |
|
126 |
+
interface.launch(share=True,show_error=True)
|