Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/genlocale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: genlocale
on: [ push ]
jobs:
golangci:
name: genlocale
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@master

- name: Run locale generation
run: |
python3 extract_locale.py
cd locale
python3 locale_diff.py

- name: Commit back
if: ${{ !github.head_ref }}
continue-on-error: true
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add --all
git commit -m "🎨 同步 locale"
36 changes: 36 additions & 0 deletions .github/workflows/unitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: unitest
on: [ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [ubuntu-latest]
fail-fast: false

steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt -y install ffmpeg
sudo apt -y install -qq aria2
aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main/hubert_base.pt -d ./ -o hubert_base.pt
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
pip install torch torchvision torchaudio
pip install -r requirements.txt
- name: Test step 1 & 2
run: |
mkdir -p logs/mi-test
touch logs/mi-test/preprocess.log
python trainset_preprocess_pipeline_print.py logs/mute/0_gt_wavs 48000 8 logs/mi-test True
touch logs/mi-test/extract_f0_feature.log
python extract_f0_print.py logs/mi-test $(nproc) pm
python extract_feature_print.py cpu 1 0 0 logs/mi-test
2 changes: 2 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
parser.add_argument("--pycmd", type=str, default="python", help="Python command")
parser.add_argument("--colab", action='store_true', help="Launch in colab")
parser.add_argument("--noparallel", action='store_true', help="Disable parallel processing")
parser.add_argument("--noautoopen", action='store_true', help="Do not open in browser automatically")
cmd_opts = parser.parse_args()

python_cmd=cmd_opts.pycmd
listen_port=cmd_opts.port
iscolab=cmd_opts.colab
noparallel=cmd_opts.noparallel
noautoopen=cmd_opts.noautoopen
########################命令行参数########################

import sys
Expand Down
30 changes: 15 additions & 15 deletions extract_locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
import re

# Define regular expression patterns
pattern = r'i18n\([^)]*\)'
pattern = r"""i18n\((["'][^"']+["'])\)"""

# Initialize the dictionary to store key-value pairs
data = {}

# Extract labels from infer-webui.py
with open('infer-web.py', 'r', encoding='utf-8') as f:
contents = f.read()
matches = re.findall(pattern, contents)
for match in matches:
key = match.strip('()"')
data[key] = key
def process(fn: str):
global data
with open(fn, 'r', encoding='utf-8') as f:
contents = f.read()
matches = re.findall(pattern, contents)
for key in matches:
key = eval(key)
print("extract:", key)
data[key] = key

# Extract labels from gui.py
with open('gui.py', 'r', encoding='utf-8') as f:
contents = f.read()
matches = re.findall(pattern, contents)
for match in matches:
key = match.strip('()"')
data[key] = key
print("processing infer-web.py")
process('infer-web.py')

print("processing gui.py")
process('gui.py')

# Save as a JSON file
with open('./locale/zh_CN.json', 'w', encoding='utf-8') as f:
Expand Down
28 changes: 14 additions & 14 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,30 @@ def launcher(self):
input_devices,output_devices,_, _=self.get_devices()
layout=[
[
sg.Frame(title=i18n('加载模型/Load Model'),layout=[
[sg.Input(default_text='TEMP\\atri.pth',key='pth_path'),sg.FileBrowse(i18n('选择.pth文件/.pth File'))],
[sg.Input(default_text='TEMP\\added_IVF512_Flat_atri_baseline_src_feat.index',key='index_path'),sg.FileBrowse(i18n('选择.index文件/.index File'))],
[sg.Input(default_text='TEMP\\big_src_feature_atri.npy',key='npy_path'),sg.FileBrowse(i18n('选择.npy文件/.npy File'))]
sg.Frame(title=i18n('加载模型'),layout=[
[sg.Input(default_text='TEMP\\atri.pth',key='pth_path'),sg.FileBrowse(i18n('选择.pth文件'))],
[sg.Input(default_text='TEMP\\added_IVF512_Flat_atri_baseline_src_feat.index',key='index_path'),sg.FileBrowse(i18n('选择.index文件'))],
[sg.Input(default_text='TEMP\\big_src_feature_atri.npy',key='npy_path'),sg.FileBrowse(i18n('选择.npy文件'))]
])
],
[
sg.Frame(layout=[
[sg.Text(i18n("输入设备/Input Device")),sg.Combo(input_devices,key='sg_input_device',default_value=input_devices[sd.default.device[0]])],
[sg.Text(i18n("输出设备/Output Device")),sg.Combo(output_devices,key='sg_output_device',default_value=output_devices[sd.default.device[1]])]
],title=i18n("音频设备(请使用同种类驱动)/Audio Devices"))
[sg.Text(i18n("输入设备")),sg.Combo(input_devices,key='sg_input_device',default_value=input_devices[sd.default.device[0]])],
[sg.Text(i18n("输出设备")),sg.Combo(output_devices,key='sg_output_device',default_value=output_devices[sd.default.device[1]])]
],title=i18n("音频设备(请使用同种类驱动)"))
],
[
sg.Frame(layout=[
[sg.Text(i18n("响应阈值/Silence Threhold")),sg.Slider(range=(-60,0),key='threhold',resolution=1,orientation='h',default_value=-30)],
[sg.Text(i18n("音调设置/Pitch Offset")),sg.Slider(range=(-24,24),key='pitch',resolution=1,orientation='h',default_value=12)]
[sg.Text(i18n("响应阈值")),sg.Slider(range=(-60,0),key='threhold',resolution=1,orientation='h',default_value=-30)],
[sg.Text(i18n("音调设置")),sg.Slider(range=(-24,24),key='pitch',resolution=1,orientation='h',default_value=12)]

],title=i18n("常规设置/Common")),
],title=i18n("常规设置")),
sg.Frame(layout=[
[sg.Text(i18n("采样长度/Sample Length")),sg.Slider(range=(0.1,3.0),key='block_time',resolution=0.1,orientation='h',default_value=1.0)],
[sg.Text(i18n("淡入淡出长度/Crossfade Length")),sg.Slider(range=(0.01,0.15),key='crossfade_length',resolution=0.01,orientation='h',default_value=0.08)],
[sg.Text(i18n("额外推理时长/Extra Length")),sg.Slider(range=(0.05,3.00),key='extra_time',resolution=0.01,orientation='h',default_value=0.05)],
[sg.Text(i18n("采样长度")),sg.Slider(range=(0.1,3.0),key='block_time',resolution=0.1,orientation='h',default_value=1.0)],
[sg.Text(i18n("淡入淡出长度")),sg.Slider(range=(0.01,0.15),key='crossfade_length',resolution=0.01,orientation='h',default_value=0.08)],
[sg.Text(i18n("额外推理时长")),sg.Slider(range=(0.05,3.00),key='extra_time',resolution=0.01,orientation='h',default_value=0.05)],
[sg.Checkbox(i18n('输出降噪/Output Noisereduce'),key='noise_reduce')]
],title=i18n("性能设置/Performance"))
],title=i18n("性能设置"))
],
[sg.Button(i18n("开始音频转换"),key='start_vc'),sg.Button(i18n("停止音频转换"),key='stop_vc')]
]
Expand Down
Loading