Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,45 +135,49 @@ def text_to_audio(
|
|
| 135 |
log.info(f'Saved audio to {audio_save_path}')
|
| 136 |
return audio_save_path
|
| 137 |
|
| 138 |
-
#
|
| 139 |
video_to_audio_tab = gr.Interface(
|
| 140 |
fn=video_to_audio,
|
| 141 |
description="""
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
CVPR 2025 — HK Cheng, M. Ishii, A. Hayakawa, T. Shibuya, A. Schwing, Y. Mitsufuji.
|
| 145 |
""",
|
| 146 |
inputs=[
|
| 147 |
-
gr.Video(),
|
| 148 |
-
gr.Text(label='Prompt'),
|
| 149 |
-
gr.Text(label='
|
| 150 |
-
gr.Number(label='Seed (
|
| 151 |
-
gr.Number(label='Num steps', value=25, precision=0, minimum=1),
|
| 152 |
-
gr.Number(label='Guidance Strength', value=4.5, minimum=1),
|
| 153 |
-
gr.Number(label='
|
| 154 |
],
|
| 155 |
-
outputs='
|
| 156 |
cache_examples=False,
|
| 157 |
-
title='
|
| 158 |
)
|
| 159 |
|
|
|
|
| 160 |
text_to_audio_tab = gr.Interface(
|
| 161 |
fn=text_to_audio,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
inputs=[
|
| 163 |
-
gr.Text(label='Prompt'),
|
| 164 |
-
gr.Text(label='
|
| 165 |
-
gr.Number(label='Seed (
|
| 166 |
-
gr.Number(label='Num steps', value=25, precision=0, minimum=1),
|
| 167 |
-
gr.Number(label='Guidance Strength', value=4.5, minimum=1),
|
| 168 |
-
gr.Number(label='
|
| 169 |
],
|
| 170 |
-
outputs='
|
| 171 |
cache_examples=False,
|
| 172 |
-
title='
|
| 173 |
)
|
| 174 |
|
| 175 |
if __name__ == "__main__":
|
| 176 |
gr.TabbedInterface(
|
| 177 |
[video_to_audio_tab, text_to_audio_tab],
|
| 178 |
-
['Video
|
| 179 |
).launch(share=True)
|
|
|
|
| 135 |
log.info(f'Saved audio to {audio_save_path}')
|
| 136 |
return audio_save_path
|
| 137 |
|
| 138 |
+
# Tab Video → Audio
|
| 139 |
video_to_audio_tab = gr.Interface(
|
| 140 |
fn=video_to_audio,
|
| 141 |
description="""
|
| 142 |
+
Dự án: Lồng âm thanh cho video.<br>
|
| 143 |
+
<b>Tác giả:</b> Lý Trần | <b>Cộng đồng:</b> LTTEAM
|
|
|
|
| 144 |
""",
|
| 145 |
inputs=[
|
| 146 |
+
gr.Video(label='Video đầu vào'),
|
| 147 |
+
gr.Text(label='Lời nhắc (Prompt)'),
|
| 148 |
+
gr.Text(label='Lời nhắc tiêu cực', value='music'),
|
| 149 |
+
gr.Number(label='Seed (–1: ngẫu nhiên)', value=-1, precision=0, minimum=-1),
|
| 150 |
+
gr.Number(label='Số bước (Num steps)', value=25, precision=0, minimum=1),
|
| 151 |
+
gr.Number(label='Độ mạnh hướng dẫn (Guidance Strength)', value=4.5, minimum=1),
|
| 152 |
+
gr.Number(label='Thời lượng (giây)', value=8, minimum=1),
|
| 153 |
],
|
| 154 |
+
outputs=gr.Video(label='Video kết quả'),
|
| 155 |
cache_examples=False,
|
| 156 |
+
title='LTTEAM - Lồng tiếng từ video',
|
| 157 |
)
|
| 158 |
|
| 159 |
+
# Tab Văn bản → Audio
|
| 160 |
text_to_audio_tab = gr.Interface(
|
| 161 |
fn=text_to_audio,
|
| 162 |
+
description="""
|
| 163 |
+
Dự án: Lồng âm thanh cho video.<br>
|
| 164 |
+
<b>Tác giả:</b> Lý Trần | <b>Cộng đồng:</b> LTTEAM
|
| 165 |
+
""",
|
| 166 |
inputs=[
|
| 167 |
+
gr.Text(label='Lời nhắc (Prompt)'),
|
| 168 |
+
gr.Text(label='Lời nhắc tiêu cực'),
|
| 169 |
+
gr.Number(label='Seed (–1: ngẫu nhiên)', value=-1, precision=0, minimum=-1),
|
| 170 |
+
gr.Number(label='Số bước (Num steps)', value=25, precision=0, minimum=1),
|
| 171 |
+
gr.Number(label='Độ mạnh hướng dẫn (Guidance Strength)', value=4.5, minimum=1),
|
| 172 |
+
gr.Number(label='Thời lượng (giây)', value=8, minimum=1),
|
| 173 |
],
|
| 174 |
+
outputs=gr.Audio(label='Âm thanh kết quả'),
|
| 175 |
cache_examples=False,
|
| 176 |
+
title='LTTEAM - Lồng tiếng từ video',
|
| 177 |
)
|
| 178 |
|
| 179 |
if __name__ == "__main__":
|
| 180 |
gr.TabbedInterface(
|
| 181 |
[video_to_audio_tab, text_to_audio_tab],
|
| 182 |
+
['Video thành Âm thanh', 'Văn bản thành Âm thanh']
|
| 183 |
).launch(share=True)
|