Spaces:
Build error
Build error
Haoxin Chen
commited on
Commit
·
8531aba
1
Parent(s):
fe42b63
add queue and max_frame_stride set to 100
Browse files- app.py +2 -1
- videocontrol_test.py +3 -3
app.py
CHANGED
@@ -69,7 +69,7 @@ def videocrafter_demo(result_dir='./tmp/'):
|
|
69 |
vc_cfg_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.5, label='CFG Scale', value=15.0, elem_id="vc_cfg_scale")
|
70 |
with gr.Row():
|
71 |
vc_steps = gr.Slider(minimum=1, maximum=200, step=1, elem_id="vc_steps", label="Sampling steps", value=50)
|
72 |
-
frame_stride = gr.Slider(minimum=0 , maximum=
|
73 |
|
74 |
vc_end_btn = gr.Button("Send")
|
75 |
with gr.Tab(label='Result'):
|
@@ -94,5 +94,6 @@ def videocrafter_demo(result_dir='./tmp/'):
|
|
94 |
if __name__ == "__main__":
|
95 |
result_dir = os.path.join('./', 'results')
|
96 |
videocrafter_iface = videocrafter_demo(result_dir)
|
|
|
97 |
videocrafter_iface.launch()
|
98 |
# videocrafter_iface.launch(server_name='0.0.0.0', server_port=80)
|
|
|
69 |
vc_cfg_scale = gr.Slider(minimum=1.0, maximum=30.0, step=0.5, label='CFG Scale', value=15.0, elem_id="vc_cfg_scale")
|
70 |
with gr.Row():
|
71 |
vc_steps = gr.Slider(minimum=1, maximum=200, step=1, elem_id="vc_steps", label="Sampling steps", value=50)
|
72 |
+
frame_stride = gr.Slider(minimum=0 , maximum=100, step=1, label='Frame Stride', value=0, elem_id="vc_frame_stride")
|
73 |
|
74 |
vc_end_btn = gr.Button("Send")
|
75 |
with gr.Tab(label='Result'):
|
|
|
94 |
if __name__ == "__main__":
|
95 |
result_dir = os.path.join('./', 'results')
|
96 |
videocrafter_iface = videocrafter_demo(result_dir)
|
97 |
+
videocrafter_iface.queue(concurrency_count=1, max_size=10)
|
98 |
videocrafter_iface.launch()
|
99 |
# videocrafter_iface.launch(server_name='0.0.0.0', server_port=80)
|
videocontrol_test.py
CHANGED
@@ -31,9 +31,9 @@ def load_video(filepath, frame_stride, video_size=(256,256), video_frames=16):
|
|
31 |
frame_stride = max_frames / video_frames
|
32 |
# if temp_stride < 1:
|
33 |
# info_str = "Warning: The length of the current input video is less than 16 frames, we will automatically fill to 16 frames for you.\n"
|
34 |
-
if frame_stride >
|
35 |
-
frame_stride =
|
36 |
-
info_str += "Warning: The current input video length is longer than
|
37 |
info_str += f"Frame Stride is set to {frame_stride}"
|
38 |
frame_indices = [int(frame_stride*i) for i in range(video_frames)]
|
39 |
frames = vidreader.get_batch(frame_indices)
|
|
|
31 |
frame_stride = max_frames / video_frames
|
32 |
# if temp_stride < 1:
|
33 |
# info_str = "Warning: The length of the current input video is less than 16 frames, we will automatically fill to 16 frames for you.\n"
|
34 |
+
if frame_stride > 100:
|
35 |
+
frame_stride = 100
|
36 |
+
info_str += "Warning: The current input video length is longer than 1600 frames, we will process only the first 1600 frames.\n"
|
37 |
info_str += f"Frame Stride is set to {frame_stride}"
|
38 |
frame_indices = [int(frame_stride*i) for i in range(video_frames)]
|
39 |
frames = vidreader.get_batch(frame_indices)
|