Delete 全流程一键版.sh
Browse files
全流程一键版.sh
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
|
3 |
-
# Change directory
|
4 |
-
cd /mnt/workspace/uvr5/MDX23v24
|
5 |
-
|
6 |
-
# 设置 HF_ENDPOINT 环境变量
|
7 |
-
export HF_ENDPOINT="https://hf-mirror.com"
|
8 |
-
|
9 |
-
input_folder="/mnt/workspace/input"
|
10 |
-
output_folder="/mnt/workspace/uvr5/output"
|
11 |
-
|
12 |
-
for file_path in $(ls -1 $input_folder); do
|
13 |
-
filename=$(basename "$file_path" | cut -d. -f1)
|
14 |
-
# 调用 inference.py,并传入环境变量 HF_ENDPOINT
|
15 |
-
python inference.py --vocals_only --large_gpu --use_InstVoc --use_VitLarge --use_BSRoformer --input_audio "$input_folder/$file_path" --output_folder "$output_folder"
|
16 |
-
done
|
17 |
-
|
18 |
-
# Move and convert files
|
19 |
-
source_folder="/mnt/workspace/uvr5/output"
|
20 |
-
target_folder="/mnt/workspace/uvr5/伴奏"
|
21 |
-
for file_name in $(ls $source_folder)
|
22 |
-
do
|
23 |
-
if [[ $file_name == *"_instrum.wav" ]]
|
24 |
-
then
|
25 |
-
file_path="$source_folder/$file_name"
|
26 |
-
target_path="$target_folder/$file_name"
|
27 |
-
mv $file_path $target_path
|
28 |
-
mp3_file_path="${target_path%.wav}.mp3"
|
29 |
-
ffmpeg -i $target_path -vn -ar 44100 -ac 2 -b:a 320k -loglevel panic $mp3_file_path
|
30 |
-
rm $target_path
|
31 |
-
fi
|
32 |
-
done
|
33 |
-
|
34 |
-
# Change directory
|
35 |
-
cd /mnt/workspace/uvr5
|
36 |
-
|
37 |
-
# Run uvr.py
|
38 |
-
python uvr.py
|
39 |
-
|
40 |
-
# Move and convert files
|
41 |
-
source_folder="/mnt/workspace/uvr5/echo"
|
42 |
-
target_folder="/mnt/workspace/uvr5/伴奏"
|
43 |
-
for file_name in $(ls $source_folder)
|
44 |
-
do
|
45 |
-
if [[ $file_name == *"和声_"* && $file_name == *.wav ]]
|
46 |
-
then
|
47 |
-
file_path="$source_folder/$file_name"
|
48 |
-
target_path="$target_folder/$file_name"
|
49 |
-
mv $file_path $target_path
|
50 |
-
mp3_file_path="${target_path%.wav}.mp3"
|
51 |
-
ffmpeg -i $target_path -vn -ar 44100 -ac 2 -b:a 320k -loglevel panic $mp3_file_path
|
52 |
-
rm $target_path
|
53 |
-
fi
|
54 |
-
done
|
55 |
-
|
56 |
-
# Run deecho.py
|
57 |
-
python deecho.py -d cuda -model_path /mnt/workspace/uvr5/uvr5_weights/VR-DeEchoAggressive.pth -audio_path /mnt/workspace/uvr5/echo/ -is_half False -save_path /mnt/workspace/uvr5/人声/ -model_params 4band_v3
|
58 |
-
|
59 |
-
# Convert files to mp3 and remove wav files
|
60 |
-
input_folder='/mnt/workspace/uvr5/人声/'
|
61 |
-
output_folder='/mnt/workspace/uvr5/人声/'
|
62 |
-
for file in $(ls $input_folder)
|
63 |
-
do
|
64 |
-
if [[ $file == *"人声_"* && $file == *.wav ]]
|
65 |
-
then
|
66 |
-
input_path="$input_folder/$file"
|
67 |
-
output_file="${file%.wav}.mp3"
|
68 |
-
output_path="$output_folder/$output_file"
|
69 |
-
ffmpeg -i $input_path -vn -ar 44100 -ac 2 -b:a 320k -loglevel panic $output_path
|
70 |
-
fi
|
71 |
-
done
|
72 |
-
|
73 |
-
# Remove wav files
|
74 |
-
for file in $(ls $input_folder)
|
75 |
-
do
|
76 |
-
if [[ $file == *.wav ]]
|
77 |
-
then
|
78 |
-
file_path="$input_folder/$file"
|
79 |
-
rm $file_path
|
80 |
-
fi
|
81 |
-
done
|
82 |
-
echo -e "\033[32m> 已将所有input文件夹内的音频完成分离,人声在 /mnt/workspace/uvr5/人声/ 文件夹内,伴奏及和声在 /mnt/workspace/uvr5/伴奏/ 文件夹内。 \033[0m"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|