LTTEAM commited on
Commit
a6688a4
·
verified ·
1 Parent(s): 038d4d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -22
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
- # Cấu hình giao diện Gradio
139
  video_to_audio_tab = gr.Interface(
140
  fn=video_to_audio,
141
  description="""
142
- Project page: <a href="https://hkchengrex.com/MMAudio/">MMAudio</a><br>
143
- Code: <a href="https://github.com/hkchengrex/MMAudio">GitHub/MMAudio</a><br>
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='Negative prompt', value='music'),
150
- gr.Number(label='Seed (-1: random)', value=-1, precision=0, minimum=-1),
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='Duration (sec)', value=8, minimum=1),
154
  ],
155
- outputs='playable_video',
156
  cache_examples=False,
157
- title='MMAudio — Video-to-Audio Synthesis',
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='Negative prompt'),
165
- gr.Number(label='Seed (-1: random)', value=-1, precision=0, minimum=-1),
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='Duration (sec)', value=8, minimum=1),
169
  ],
170
- outputs='audio',
171
  cache_examples=False,
172
- title='MMAudio — Text-to-Audio Synthesis',
173
  )
174
 
175
  if __name__ == "__main__":
176
  gr.TabbedInterface(
177
  [video_to_audio_tab, text_to_audio_tab],
178
- ['Video-to-Audio', 'Text-to-Audio']
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 &nbsp;|&nbsp; <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 &nbsp;|&nbsp; <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)