Spaces:
Running
on
A10G
Running
on
A10G
add progress bar
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def export_to_video(frames: np.ndarray, fps: int) -> str:
|
|
48 |
writer.close()
|
49 |
return out_file.name
|
50 |
|
51 |
-
def infer(image_init):
|
52 |
prompt = get_caption(image_init)
|
53 |
video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).frames[0]
|
54 |
video_path = export_to_video(video_frames, 12)
|
@@ -138,7 +138,7 @@ with gr.Blocks(css=css) as demo:
|
|
138 |
image_init = gr.Image(label="Image Init", type="filepath", sources=["upload"], elem_id="image-init")
|
139 |
#inference_steps = gr.Slider(label="Inference Steps", minimum=10, maximum=100, step=1, value=40, interactive=False)
|
140 |
submit_btn = gr.Button("Submit")
|
141 |
-
coca_cap = gr.Textbox(label="Caption", placeholder="
|
142 |
video_result = gr.Video(label="Video Output", elem_id="video-output")
|
143 |
|
144 |
submit_btn.click(
|
|
|
48 |
writer.close()
|
49 |
return out_file.name
|
50 |
|
51 |
+
def infer(image_init, progress=gr.Progress(track_tqdm=True)):
|
52 |
prompt = get_caption(image_init)
|
53 |
video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).frames[0]
|
54 |
video_path = export_to_video(video_frames, 12)
|
|
|
138 |
image_init = gr.Image(label="Image Init", type="filepath", sources=["upload"], elem_id="image-init")
|
139 |
#inference_steps = gr.Slider(label="Inference Steps", minimum=10, maximum=100, step=1, value=40, interactive=False)
|
140 |
submit_btn = gr.Button("Submit")
|
141 |
+
coca_cap = gr.Textbox(label="Caption", placeholder="Kosmos-2 caption will be displayed here", elem_id="coca-cap-in")
|
142 |
video_result = gr.Video(label="Video Output", elem_id="video-output")
|
143 |
|
144 |
submit_btn.click(
|