Blane187 commited on
Commit
143a1bc
·
verified ·
1 Parent(s): af2a577

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -18
app.py CHANGED
@@ -44,24 +44,27 @@ with gr.Blocks(title="RVC UI") as app:
44
  vc_output1 = gr.Textbox(label="Output information", interactive=False)
45
  vc_output2 = gr.Audio(label="Export audio (click on the three dots in the lower right corner to download)", type="filepath", interactive=False)
46
  #refresh_button.click(fn=change_choices, inputs=[], outputs=[models, file_index2], api_name="infer_refresh")
47
- with gr.TabItem("Batch inference"):
48
- gr.Markdown("<center>Batch conversion\n. Enter the folder containing the audio files to be converted or upload multiple audio files. The converted audio will be output in the specified folder (default: 'opt').")
49
- vc_transform1 = gr.Number(label="Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12)", value=0)
50
- dir_input = gr.Textbox(label="Enter the path of the audio folder to be processed (copy it from the address bar of the file manager)", placeholder="C:\\Users\\Desktop\\input_vocal_dir")
51
- inputs = gr.File(file_count="multiple", label="Multiple audio files can also be imported. If a folder path exists, this input is ignored.")
52
- opt_input = gr.Textbox(label="Specify output folder", value="opt")
53
- file_index4 = gr.Dropdown(label="Auto-detect index path and select from the dropdown", choices=sorted(index_paths), interactive=True)
54
- file_index3 = gr.File(label="Path to the feature index file. Leave blank to use the selected result from the dropdown")
55
- #refresh_button.click(fn=lambda: change_choices()[1], inputs=[], outputs=file_index4, api_name="infer_refresh_batch")
56
- f0method1 = gr.Radio(label="Select the pitch extraction algorithm ('pm': faster extraction but lower-quality speech; 'harvest': better bass but extremely slow; 'crepe': better quality but GPU intensive), 'rmvpe': best quality, and little GPU requirement", choices=["pm", "harvest", "crepe", "rmvpe", "fcpe"], value="rmvpe", interactive=True)
57
- resample_sr1 = gr.Slider(minimum=0, maximum=48000, label="Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling", value=0, step=1, interactive=True)
58
- rms_mix_rate1 = gr.Slider(minimum=0, maximum=1, label="Adjust the volume envelope scaling. Closer to 0, the more it mimicks the volume of the original vocals. Can help mask noise and make volume sound more natural when set relatively low. Closer to 1 will be more of a consistently loud volume", value=1, interactive=True)
59
- protect1 = gr.Slider(minimum=0, maximum=0.5, label="Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy", value=0.33, step=0.01, interactive=True)
60
- filter_radius1 = gr.Slider(minimum=0, maximum=7, label="If >=3: apply median filtering to the harvested pitch results. The value represents the filter radius and can reduce breathiness.", value=3, step=1, interactive=True)
61
- index_rate2 = gr.Slider(minimum=0, maximum=1, label="Feature searching ratio", value=1, interactive=True)
62
- format1 = gr.Radio(label="Export file format", choices=["wav", "flac", "mp3", "m4a"], value="wav", interactive=True)
63
- but1 = gr.Button("Convert", variant="primary")
64
- vc_output3 = gr.Textbox(label="Output information", interactive=False)
 
 
 
65
 
66
  with gr.TabItem("Train"):
67
  gr.Markdown("### Step 1. Fill in the experimental configuration.\nExperimental data is stored in the 'logs' folder, with each experiment having a separate folder. Manually enter the experiment name path, which contains the experimental configuration, logs, and trained model files.")
 
44
  vc_output1 = gr.Textbox(label="Output information", interactive=False)
45
  vc_output2 = gr.Audio(label="Export audio (click on the three dots in the lower right corner to download)", type="filepath", interactive=False)
46
  #refresh_button.click(fn=change_choices, inputs=[], outputs=[models, file_index2], api_name="infer_refresh")
47
+ with gr.Accordion("Batch inference"):
48
+ gr.Markdown("<center>Batch conversion\n. Enter the folder containing the audio files to be converted or upload multiple audio files. The converted audio will be output in the specified folder (default: 'opt').")
49
+ vc_transform1 = gr.Number(label="Transpose (integer, number of semitones, raise by an octave: 12, lower by an octave: -12)", value=0)
50
+ dir_input = gr.Textbox(label="Enter the path of the audio folder to be processed (copy it from the address bar of the file manager)", placeholder="C:\\Users\\Desktop\\input_vocal_dir")
51
+ inputs = gr.File(file_count="multiple", label="Multiple audio files can also be imported. If a folder path exists, this input is ignored.")
52
+ opt_input = gr.Textbox(label="Specify output folder", value="opt")
53
+ file_index4 = gr.Dropdown(label="Auto-detect index path and select from the dropdown", choices=sorted(index_paths), interactive=True)
54
+ file_index3 = gr.File(label="Path to the feature index file. Leave blank to use the selected result from the dropdown")
55
+ #refresh_button.click(fn=lambda: change_choices()[1], inputs=[], outputs=file_index4, api_name="infer_refresh_batch")
56
+ f0method1 = gr.Radio(label="Select the pitch extraction algorithm ('pm': faster extraction but lower-quality speech; 'harvest': better bass but extremely slow; 'crepe': better quality but GPU intensive), 'rmvpe': best quality, and little GPU requirement", choices=["pm", "harvest", "crepe", "rmvpe", "fcpe"], value="rmvpe", interactive=True)
57
+ resample_sr1 = gr.Slider(minimum=0, maximum=48000, label="Resample the output audio in post-processing to the final sample rate. Set to 0 for no resampling", value=0, step=1, interactive=True)
58
+ rms_mix_rate1 = gr.Slider(minimum=0, maximum=1, label="Adjust the volume envelope scaling. Closer to 0, the more it mimicks the volume of the original vocals. Can help mask noise and make volume sound more natural when set relatively low. Closer to 1 will be more of a consistently loud volume", value=1, interactive=True)
59
+ protect1 = gr.Slider(minimum=0, maximum=0.5, label="Protect voiceless consonants and breath sounds to prevent artifacts such as tearing in electronic music. Set to 0.5 to disable. Decrease the value to increase protection, but it may reduce indexing accuracy", value=0.33, step=0.01, interactive=True)
60
+ filter_radius1 = gr.Slider(minimum=0, maximum=7, label="If >=3: apply median filtering to the harvested pitch results. The value represents the filter radius and can reduce breathiness.", value=3, step=1, interactive=True)
61
+ index_rate2 = gr.Slider(minimum=0, maximum=1, label="Feature searching ratio", value=1, interactive=True)
62
+ format1 = gr.Radio(label="Export file format", choices=["wav", "flac", "mp3", "m4a"], value="wav", interactive=True)
63
+ but1 = gr.Button("Convert", variant="primary")
64
+ vc_output3 = gr.Textbox(
65
+ label="Output information",
66
+ interactive=False
67
+ )
68
 
69
  with gr.TabItem("Train"):
70
  gr.Markdown("### Step 1. Fill in the experimental configuration.\nExperimental data is stored in the 'logs' folder, with each experiment having a separate folder. Manually enter the experiment name path, which contains the experimental configuration, logs, and trained model files.")