jhj0517 commited on
Commit
fbcbf8a
1 Parent(s): d11cbce

Add UVR BGM separation

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -48,6 +48,7 @@ class App:
48
  whisper_params = self.default_params["whisper"]
49
  vad_params = self.default_params["vad"]
50
  diarization_params = self.default_params["diarization"]
 
51
 
52
  with gr.Row():
53
  dd_model = gr.Dropdown(choices=self.whisper_inf.available_models, value=whisper_params["model_size"],
@@ -150,6 +151,17 @@ class App:
150
  nb_speech_pad_ms = gr.Number(label="Speech Padding (ms)", precision=0, value=vad_params["speech_pad_ms"],
151
  info="Final speech chunks are padded by this time each side")
152
 
 
 
 
 
 
 
 
 
 
 
 
153
  with gr.Accordion("Diarization", open=False):
154
  cb_diarize = gr.Checkbox(label="Enable Diarization", value=diarization_params["is_diarize"])
155
  tb_hf_token = gr.Text(label="HuggingFace Token", value=diarization_params["hf_token"],
@@ -179,7 +191,9 @@ class App:
179
  hallucination_silence_threshold=nb_hallucination_silence_threshold, hotwords=tb_hotwords,
180
  language_detection_threshold=nb_language_detection_threshold,
181
  language_detection_segments=nb_language_detection_segments,
182
- prompt_reset_on_temperature=sld_prompt_reset_on_temperature
 
 
183
  ),
184
  dd_file_format,
185
  cb_timestamp
 
48
  whisper_params = self.default_params["whisper"]
49
  vad_params = self.default_params["vad"]
50
  diarization_params = self.default_params["diarization"]
51
+ uvr_params = self.default_params["bgm-separation"]
52
 
53
  with gr.Row():
54
  dd_model = gr.Dropdown(choices=self.whisper_inf.available_models, value=whisper_params["model_size"],
 
151
  nb_speech_pad_ms = gr.Number(label="Speech Padding (ms)", precision=0, value=vad_params["speech_pad_ms"],
152
  info="Final speech chunks are padded by this time each side")
153
 
154
+ with gr.Accordion("BGM Separation", open=False):
155
+ cb_bgm_separation = gr.Checkbox(label="Enable BGM separation", value=uvr_params["is_separate_bgm"],
156
+ interactive=True)
157
+ dd_uvr_device = gr.Dropdown(label="Device", value=self.music_separator.device,
158
+ choices=self.music_separator.available_devices)
159
+ dd_uvr_model_size = gr.Dropdown(label="Model", value=uvr_params["model_size"],
160
+ choices=self.music_separator.available_models)
161
+ nb_uvr_segment_size = gr.Number(label="Segment Size", value=uvr_params["segment_size"], precision=0)
162
+ cb_uvr_save_file = gr.Checkbox(label="Save Separated Files to Output Directory",
163
+ value=uvr_params["save_file"], interactive=True)
164
+
165
  with gr.Accordion("Diarization", open=False):
166
  cb_diarize = gr.Checkbox(label="Enable Diarization", value=diarization_params["is_diarize"])
167
  tb_hf_token = gr.Text(label="HuggingFace Token", value=diarization_params["hf_token"],
 
191
  hallucination_silence_threshold=nb_hallucination_silence_threshold, hotwords=tb_hotwords,
192
  language_detection_threshold=nb_language_detection_threshold,
193
  language_detection_segments=nb_language_detection_segments,
194
+ prompt_reset_on_temperature=sld_prompt_reset_on_temperature, is_bgm_separate=cb_bgm_separation,
195
+ uvr_device=dd_uvr_device, uvr_model_size=dd_uvr_model_size, uvr_segment_size=nb_uvr_segment_size,
196
+ uvr_save_file=cb_uvr_save_file
197
  ),
198
  dd_file_format,
199
  cb_timestamp