Rooni commited on
Commit
1c743c1
·
1 Parent(s): cb8242c

Update src/webui.py

Browse files
Files changed (1) hide show
  1. src/webui.py +36 -36
src/webui.py CHANGED
@@ -155,11 +155,11 @@ def show_hop_slider(pitch_detection_algo):
155
 
156
 
157
  if __name__ == '__main__':
158
- parser = ArgumentParser(description='Generate a AI cover song in the song_output/id directory.', add_help=True)
159
- parser.add_argument("--share", action="store_true", dest="share_enabled", default=False, help="Enable sharing")
160
- parser.add_argument("--listen", action="store_true", default=False, help="Make the WebUI reachable from your local network.")
161
- parser.add_argument('--listen-host', type=str, help='The hostname that the server will use.')
162
- parser.add_argument('--listen-port', type=int, help='The listening port that the server will use.')
163
  args = parser.parse_args()
164
 
165
  voice_models = get_current_models(rvc_models_dir)
@@ -173,12 +173,12 @@ if __name__ == '__main__':
173
  with gr.Accordion('Main Options'):
174
  with gr.Row():
175
  with gr.Column():
176
- rvc_model = gr.Dropdown(voice_models, label='Voice Models', info='Models folder "AICoverGen --> rvc_models". After new models are added into this folder, click the refresh button')
177
  ref_btn = gr.Button('Refresh Models 🔁', variant='primary')
178
 
179
  with gr.Column() as yt_link_col:
180
- song_input = gr.Text(label='Song input', info='Link to a song on YouTube or full path to a local file. For file upload, click the button below. Example: https://www.youtube.com/watch?v=M-mtdN6R3bQ')
181
- show_file_upload_button = gr.Button('Upload file instead')
182
 
183
  with gr.Column(visible=False) as file_upload_col:
184
  local_file = gr.File(label='Audio file')
@@ -187,22 +187,22 @@ if __name__ == '__main__':
187
  song_input_file.upload(process_file_upload, inputs=[song_input_file], outputs=[local_file, song_input])
188
 
189
  with gr.Column():
190
- pitch = gr.Slider(-3, 3, value=0, step=1, label='Pitch Change (Vocals ONLY)', info='Generally, use 1 for male to female conversions and -1 for vice-versa. (Octaves)')
191
- pitch_all = gr.Slider(-12, 12, value=0, step=1, label='Overall Pitch Change', info='Changes pitch/key of vocals and instrumentals together. Altering this slightly reduces sound quality. (Semitones)')
192
  show_file_upload_button.click(swap_visibility, outputs=[file_upload_col, yt_link_col, song_input, local_file])
193
  show_yt_link_button.click(swap_visibility, outputs=[yt_link_col, file_upload_col, song_input, local_file])
194
 
195
  with gr.Accordion('Voice conversion options', open=False):
196
  with gr.Row():
197
- index_rate = gr.Slider(0, 1, value=0.5, label='Index Rate', info="Controls how much of the AI voice's accent to keep in the vocals")
198
- filter_radius = gr.Slider(0, 7, value=3, step=1, label='Filter radius', info='If >=3: apply median filtering median filtering to the harvested pitch results. Can reduce breathiness')
199
- rms_mix_rate = gr.Slider(0, 1, value=0.25, label='RMS mix rate', info="Control how much to mimic the original vocal's loudness (0) or a fixed loudness (1)")
200
- protect = gr.Slider(0, 0.5, value=0.33, label='Protect rate', info='Protect voiceless consonants and breath sounds. Set to 0.5 to disable.')
201
  with gr.Column():
202
- f0_method = gr.Dropdown(['rmvpe', 'mangio-crepe'], value='rmvpe', label='Pitch detection algorithm', info='Best option is rmvpe (clarity in vocals), then mangio-crepe (smoother vocals)')
203
- crepe_hop_length = gr.Slider(32, 320, value=128, step=1, visible=False, label='Crepe hop length', info='Lower values leads to longer conversions and higher risk of voice cracks, but better pitch accuracy.')
204
  f0_method.change(show_hop_slider, inputs=f0_method, outputs=crepe_hop_length)
205
- keep_files = gr.Checkbox(label='Keep intermediate files', info='Keep all audio files generated in the song_output/id directory, e.g. Isolated Vocals/Instrumentals. Leave unchecked to save space')
206
 
207
  with gr.Accordion('Audio mixing options', open=False):
208
  gr.Markdown('### Volume Change (decibels)')
@@ -213,13 +213,13 @@ if __name__ == '__main__':
213
 
214
  gr.Markdown('### Reverb Control on AI Vocals')
215
  with gr.Row():
216
- reverb_rm_size = gr.Slider(0, 1, value=0.15, label='Room size', info='The larger the room, the longer the reverb time')
217
- reverb_wet = gr.Slider(0, 1, value=0.2, label='Wetness level', info='Level of AI vocals with reverb')
218
- reverb_dry = gr.Slider(0, 1, value=0.8, label='Dryness level', info='Level of AI vocals without reverb')
219
- reverb_damping = gr.Slider(0, 1, value=0.7, label='Damping level', info='Absorption of high frequencies in the reverb')
220
 
221
  gr.Markdown('### Audio Output Format')
222
- output_format = gr.Dropdown(['mp3', 'wav'], value='mp3', label='Output file type', info='mp3: small file size, decent quality. wav: Large file size, best quality')
223
 
224
  with gr.Row():
225
  clear_btn = gr.ClearButton(value='Clear', components=[song_input, rvc_model, keep_files, local_file])
@@ -244,8 +244,8 @@ if __name__ == '__main__':
244
 
245
  with gr.Tab('From HuggingFace/Pixeldrain URL'):
246
  with gr.Row():
247
- model_zip_link = gr.Text(label='Download link to model', info='Should be a zip file containing a .pth model file and an optional .index file.')
248
- model_name = gr.Text(label='Name your model', info='Give your new model a unique name from your other voice models.')
249
 
250
  with gr.Row():
251
  download_btn = gr.Button('Download 🌐', variant='primary', scale=19)
@@ -257,8 +257,8 @@ if __name__ == '__main__':
257
  gr.Examples(
258
  [
259
  ['https://huggingface.co/phant0m4r/LiSA/resolve/main/LiSA.zip', 'Lisa'],
260
- ['https://pixeldrain.com/u/3tJmABXA', 'Gura'],
261
- ['https://pixeldrain.com/u/3Uf84csp', 'Yandex Alisa'],
262
  ['https://huggingface.co/Kit-Lemonfoot/kitlemonfoot_rvc_models/resolve/main/AZKi%20(Hybrid).zip', 'Azki']
263
  ],
264
  [model_zip_link, model_name],
@@ -268,11 +268,11 @@ if __name__ == '__main__':
268
 
269
  with gr.Tab('From Public Index'):
270
 
271
- gr.Markdown('## How to use')
272
- gr.Markdown('- Click Initialize public models table')
273
- gr.Markdown('- Filter models using tags or search bar')
274
- gr.Markdown('- Select a row to autofill the download link and model name')
275
- gr.Markdown('- Click Download')
276
 
277
  with gr.Row():
278
  pub_zip_link = gr.Text(label='Download link to model')
@@ -295,11 +295,11 @@ if __name__ == '__main__':
295
 
296
  # Upload tab
297
  with gr.Tab('Upload model'):
298
- gr.Markdown('## Upload locally trained RVC v2 model and index file')
299
- gr.Markdown('- Find model file (weights folder) and optional index file (logs/[name] folder)')
300
- gr.Markdown('- Compress files into zip file')
301
- gr.Markdown('- Upload zip file and give unique name for voice')
302
- gr.Markdown('- Click Upload model')
303
 
304
  with gr.Row():
305
  with gr.Column():
 
155
 
156
 
157
  if __name__ == '__main__':
158
+ parser = ArgumentParser(description='Создайте AI кавер-версию в каталоге song_output/id.', add_help=True)
159
+ parser.add_argument("--share", action="store_true", dest="share_enabled", default=False, help="Включить общий доступ")
160
+ parser.add_argument("--listen", action="store_true", default=False, help="Сделайте WebUI доступным из вашей локальной сети.")
161
+ parser.add_argument('--listen-host', type=str, help='Имя хоста, которое будет использовать сервер.')
162
+ parser.add_argument('--listen-port', type=int, help='Порт прослушивания, который будет использовать сервер.')
163
  args = parser.parse_args()
164
 
165
  voice_models = get_current_models(rvc_models_dir)
 
173
  with gr.Accordion('Main Options'):
174
  with gr.Row():
175
  with gr.Column():
176
+ rvc_model = gr.Dropdown(voice_models, label='Voice Models', info='Папка моделей «AICoverGen --> rvc_models». После добавления новых моделей в эту папку нажмите кнопку «Обновить».')
177
  ref_btn = gr.Button('Refresh Models 🔁', variant='primary')
178
 
179
  with gr.Column() as yt_link_col:
180
+ song_input = gr.Text(label='Song input', info='Ссылка на песню на YouTube или полный путь к локальному файлу. Для загрузки файла нажмите кнопку ниже. Пример: https://www.youtube.com/watch?v=M-mtdN6R3bQ')
181
+ show_file_upload_button = gr.Button('Вместо этого загрузите файл')
182
 
183
  with gr.Column(visible=False) as file_upload_col:
184
  local_file = gr.File(label='Audio file')
 
187
  song_input_file.upload(process_file_upload, inputs=[song_input_file], outputs=[local_file, song_input])
188
 
189
  with gr.Column():
190
+ pitch = gr.Slider(-3, 3, value=0, step=1, label='Pitch Change (Vocals ONLY)', info='Обычно 1 используется для преобразования мужского голоса в женский, а -1 наоборот. (Октавы)')
191
+ pitch_all = gr.Slider(-12, 12, value=0, step=1, label='Overall Pitch Change', info='Изменяет высоту/тональность вокала и инструментальной партии одновременно. Изменение этого параметра немного снижает качество звука. (Полутона)')
192
  show_file_upload_button.click(swap_visibility, outputs=[file_upload_col, yt_link_col, song_input, local_file])
193
  show_yt_link_button.click(swap_visibility, outputs=[yt_link_col, file_upload_col, song_input, local_file])
194
 
195
  with gr.Accordion('Voice conversion options', open=False):
196
  with gr.Row():
197
+ index_rate = gr.Slider(0, 1, value=0.5, label='Index Rate', info="Управляет тем, какую часть акцента голоса AI следует сохранить в вокале.")
198
+ filter_radius = gr.Slider(0, 7, value=3, step=1, label='Filter radius', info='Если >=3: применить медианную фильтрацию к собранным результатам основного тона. Может уменьшить одышку')
199
+ rms_mix_rate = gr.Slider(0, 1, value=0.25, label='RMS mix rate', info="Управляйте тем, насколько имитировать громкость исходного вокала (0) или фиксированную громкость (1).")
200
+ protect = gr.Slider(0, 0.5, value=0.33, label='Protect rate', info='Защищайте глухие согласные и звуки дыхания. Установите значение 0,5, чтобы отключить.')
201
  with gr.Column():
202
+ f0_method = gr.Dropdown(['rmvpe', 'mangio-crepe'], value='rmvpe', label='Pitch detection algorithm', info='Лучший вариант rmvpe (четкость вокала), затем mangio-crepe (более плавный вокал).')
203
+ crepe_hop_length = gr.Slider(32, 320, value=128, step=1, visible=False, label='Crepe hop length', info='Более низкие значения приводят к более длительному преобразованию и более высокому риску прерывания голоса, но к большей точности высоты тона.')
204
  f0_method.change(show_hop_slider, inputs=f0_method, outputs=crepe_hop_length)
205
+ keep_files = gr.Checkbox(label='Keep intermediate files', info='Сохраняйте все сгенерированные аудиофайлы в каталоге song_output/id, например. Изолированный вокал/инструментал. Оставьте флажок снятым, чтобы сэкономить место')
206
 
207
  with gr.Accordion('Audio mixing options', open=False):
208
  gr.Markdown('### Volume Change (decibels)')
 
213
 
214
  gr.Markdown('### Reverb Control on AI Vocals')
215
  with gr.Row():
216
+ reverb_rm_size = gr.Slider(0, 1, value=0.15, label='Room size', info='Чем больше комната, тем дольше время реверберации.')
217
+ reverb_wet = gr.Slider(0, 1, value=0.2, label='Wetness level', info='Уровень AI-вокала с реверберацией')
218
+ reverb_dry = gr.Slider(0, 1, value=0.8, label='Dryness level', info='Уровень AI-вокала без реверберации')
219
+ reverb_damping = gr.Slider(0, 1, value=0.7, label='Damping level', info='Поглощение высоких частот в реверберации')
220
 
221
  gr.Markdown('### Audio Output Format')
222
+ output_format = gr.Dropdown(['mp3', 'wav'], value='mp3', label='Output file type', info='mp3: небол��шой размер файла, достойное качество. wav: большой размер файла, лучшее качество.')
223
 
224
  with gr.Row():
225
  clear_btn = gr.ClearButton(value='Clear', components=[song_input, rvc_model, keep_files, local_file])
 
244
 
245
  with gr.Tab('From HuggingFace/Pixeldrain URL'):
246
  with gr.Row():
247
+ model_zip_link = gr.Text(label='Download link to model', info='Это должен быть ZIP-файл, содержащий файл модели .pth и необязательный файл .index.')
248
+ model_name = gr.Text(label='Name your model', info='Дайте вашей новой модели уникальное имя среди других ваших моделей голоса.')
249
 
250
  with gr.Row():
251
  download_btn = gr.Button('Download 🌐', variant='primary', scale=19)
 
257
  gr.Examples(
258
  [
259
  ['https://huggingface.co/phant0m4r/LiSA/resolve/main/LiSA.zip', 'Lisa'],
260
+ ['https://pixeldrain.com/u/3tJmABXA', '- Gura'],
261
+ ['https://pixeldrain.com/u/3Uf84csp', '- Yandex Alisa'],
262
  ['https://huggingface.co/Kit-Lemonfoot/kitlemonfoot_rvc_models/resolve/main/AZKi%20(Hybrid).zip', 'Azki']
263
  ],
264
  [model_zip_link, model_name],
 
268
 
269
  with gr.Tab('From Public Index'):
270
 
271
+ gr.Markdown('## Как использовать')
272
+ gr.Markdown('- Нажмите «Инициализировать таблицу общедоступных моделей»')
273
+ gr.Markdown('- Фильтрация моделей по тегам или строке поиска')
274
+ gr.Markdown('- Выберите строку для автозаполнения ссылки для скачивания и названия модели')
275
+ gr.Markdown('- Нажмите Загрузить')
276
 
277
  with gr.Row():
278
  pub_zip_link = gr.Text(label='Download link to model')
 
295
 
296
  # Upload tab
297
  with gr.Tab('Upload model'):
298
+ gr.Markdown('## Загрузить локально обученную модель RVC v2 и индексный файл')
299
+ gr.Markdown('- Найти файл модели (папка весов) и дополнительный индексный файл (папка журналов/[имя])')
300
+ gr.Markdown('- Сжать файлы в zip-файл')
301
+ gr.Markdown('- Загрузите zip-файл и укажите уникальное имя для голоса')
302
+ gr.Markdown('- Нажмите Загрузить модель')
303
 
304
  with gr.Row():
305
  with gr.Column():