Spaces:
Runtime error
Runtime error
Daryl Fung
commited on
Commit
•
65f781f
1
Parent(s):
5e577be
added assets
Browse files- .gitattributes +18 -0
- app.py +12 -5
- assets/.DS_Store +0 -0
- assets/indices/carol_IVF59_Flat_nprobe_1_carol_v2.index +1 -0
- assets/indices/daryl_IVF179_Flat_nprobe_1_daryl_v2.index +1 -0
- assets/indices/elmo_IVF129_Flat_nprobe_1_elmo_v2.index +1 -0
- assets/indices/francis_IVF13_Flat_nprobe_1_francis_v2.index +1 -0
- assets/indices/harry_IVF17_Flat_nprobe_1_harry_v2.index +1 -0
- assets/indices/jess_IVF12_Flat_nprobe_1_jess_v2.index +1 -0
- assets/indices/peter_IVF39_Flat_nprobe_1_peter_v2.index +1 -0
- assets/weights/carol.pth +3 -0
- assets/weights/daryl.pth +3 -0
- assets/weights/elmo.pth +3 -0
- assets/weights/francis.pth +3 -0
- assets/weights/harry.pth +3 -0
- assets/weights/jess.pth +3 -0
- assets/weights/peter.pth +3 -0
- constant.py +19 -0
.gitattributes
CHANGED
@@ -39,3 +39,21 @@ pretrained_models/2stems/checkpoint filter=lfs diff=lfs merge=lfs -text
|
|
39 |
pretrained_models/2stems/model.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
40 |
pretrained_models/2stems/model.index filter=lfs diff=lfs merge=lfs -text
|
41 |
pretrained_models/2stems/model.meta filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
pretrained_models/2stems/model.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
40 |
pretrained_models/2stems/model.index filter=lfs diff=lfs merge=lfs -text
|
41 |
pretrained_models/2stems/model.meta filter=lfs diff=lfs merge=lfs -text
|
42 |
+
assets/indices/carol_IVF59_Flat_nprobe_1_carol_v2.index filter=lfs diff=lfs merge=lfs -text
|
43 |
+
assets/indices/me_IVF59_Flat_nprobe_1_me_v2.index filter=lfs diff=lfs merge=lfs -text
|
44 |
+
assets/weights/francis.pth filter=lfs diff=lfs merge=lfs -text
|
45 |
+
assets/weights/jess.pth filter=lfs diff=lfs merge=lfs -text
|
46 |
+
assets/indices/peter_IVF39_Flat_nprobe_1_peter_v2.index filter=lfs diff=lfs merge=lfs -text
|
47 |
+
assets/weights/daryl.pth filter=lfs diff=lfs merge=lfs -text
|
48 |
+
assets/weights/elmo.pth filter=lfs diff=lfs merge=lfs -text
|
49 |
+
assets/indices/daryl_IVF179_Flat_nprobe_1_daryl_v2.index filter=lfs diff=lfs merge=lfs -text
|
50 |
+
assets/indices/elmomo_IVF59_Flat_nprobe_1_elmomo_v2.index filter=lfs diff=lfs merge=lfs -text
|
51 |
+
assets/indices/francis_IVF13_Flat_nprobe_1_francis_v2.index filter=lfs diff=lfs merge=lfs -text
|
52 |
+
assets/weights filter=lfs diff=lfs merge=lfs -text
|
53 |
+
assets/weights/peter.pth filter=lfs diff=lfs merge=lfs -text
|
54 |
+
assets/indices filter=lfs diff=lfs merge=lfs -text
|
55 |
+
assets/indices/elmo_IVF129_Flat_nprobe_1_elmo_v2.index filter=lfs diff=lfs merge=lfs -text
|
56 |
+
assets/indices/harry_IVF17_Flat_nprobe_1_harry_v2.index filter=lfs diff=lfs merge=lfs -text
|
57 |
+
assets/indices/jess_IVF12_Flat_nprobe_1_jess_v2.index filter=lfs diff=lfs merge=lfs -text
|
58 |
+
assets/weights/carol.pth filter=lfs diff=lfs merge=lfs -text
|
59 |
+
assets/weights/harry.pth filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -7,13 +7,15 @@ import os
|
|
7 |
from gradio_client import Client, file
|
8 |
import subprocess
|
9 |
|
|
|
|
|
10 |
try:
|
11 |
shutil.rmtree("output")
|
12 |
except FileNotFoundError:
|
13 |
pass
|
14 |
|
15 |
|
16 |
-
def spleeter(aud, model_file, index_file, pitch):
|
17 |
separator = Separator('spleeter:2stems')
|
18 |
filename = os.path.basename(aud).split('.')[0]
|
19 |
accompaniment_filename = f"./output/audio_example/{filename}_accompaniment.wav"
|
@@ -29,13 +31,17 @@ def spleeter(aud, model_file, index_file, pitch):
|
|
29 |
|
30 |
# send vocal for processing
|
31 |
# https://huggingface.co/spaces/r3gm/rvc_zero
|
|
|
|
|
|
|
|
|
32 |
client = Client("r3gm/rvc_zero")
|
33 |
result = client.predict(
|
34 |
audio_files=[file(vocal_filename)],
|
35 |
-
file_m=file(
|
36 |
pitch_alg="rmvpe+",
|
37 |
pitch_lvl=pitch,
|
38 |
-
file_index=file(
|
39 |
index_inf=0.75,
|
40 |
r_m_f=3,
|
41 |
e_r=0.25,
|
@@ -53,13 +59,14 @@ def spleeter(aud, model_file, index_file, pitch):
|
|
53 |
|
54 |
inputs = [
|
55 |
gr.Audio(sources='upload', label="Input Audio File", type="filepath"),
|
|
|
56 |
gr.File(
|
57 |
-
label="Model file",
|
58 |
type="filepath",
|
59 |
height=130,
|
60 |
),
|
61 |
gr.File(
|
62 |
-
label="Index file",
|
63 |
type="filepath",
|
64 |
height=130,
|
65 |
),
|
|
|
7 |
from gradio_client import Client, file
|
8 |
import subprocess
|
9 |
|
10 |
+
from constant import weights, indices
|
11 |
+
|
12 |
try:
|
13 |
shutil.rmtree("output")
|
14 |
except FileNotFoundError:
|
15 |
pass
|
16 |
|
17 |
|
18 |
+
def spleeter(aud, model_dropdown, model_file, index_file, pitch):
|
19 |
separator = Separator('spleeter:2stems')
|
20 |
filename = os.path.basename(aud).split('.')[0]
|
21 |
accompaniment_filename = f"./output/audio_example/{filename}_accompaniment.wav"
|
|
|
31 |
|
32 |
# send vocal for processing
|
33 |
# https://huggingface.co/spaces/r3gm/rvc_zero
|
34 |
+
|
35 |
+
model = model_file if model_dropdown is None else weights[model_dropdown]
|
36 |
+
index = index_file if model_dropdown is None else indices[model_dropdown]
|
37 |
+
|
38 |
client = Client("r3gm/rvc_zero")
|
39 |
result = client.predict(
|
40 |
audio_files=[file(vocal_filename)],
|
41 |
+
file_m=file(model),
|
42 |
pitch_alg="rmvpe+",
|
43 |
pitch_lvl=pitch,
|
44 |
+
file_index=file(index),
|
45 |
index_inf=0.75,
|
46 |
r_m_f=3,
|
47 |
e_r=0.25,
|
|
|
59 |
|
60 |
inputs = [
|
61 |
gr.Audio(sources='upload', label="Input Audio File", type="filepath"),
|
62 |
+
gr.Dropdown(choices=list(weights.keys()), value=list(weights.keys()), label="existing people model"),
|
63 |
gr.File(
|
64 |
+
label="Model file (use this if your existing people model does not exist in the dropdown)",
|
65 |
type="filepath",
|
66 |
height=130,
|
67 |
),
|
68 |
gr.File(
|
69 |
+
label="Index file (use this if your existing people model does not exist in the dropdown)",
|
70 |
type="filepath",
|
71 |
height=130,
|
72 |
),
|
assets/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
assets/indices/carol_IVF59_Flat_nprobe_1_carol_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/carol/added_IVF59_Flat_nprobe_1_carol_v2.index
|
assets/indices/daryl_IVF179_Flat_nprobe_1_daryl_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/daryl/added_IVF179_Flat_nprobe_1_daryl_v2.index
|
assets/indices/elmo_IVF129_Flat_nprobe_1_elmo_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/elmo/added_IVF129_Flat_nprobe_1_elmo_v2.index
|
assets/indices/francis_IVF13_Flat_nprobe_1_francis_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/francis/added_IVF13_Flat_nprobe_1_francis_v2.index
|
assets/indices/harry_IVF17_Flat_nprobe_1_harry_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/harry/added_IVF17_Flat_nprobe_1_harry_v2.index
|
assets/indices/jess_IVF12_Flat_nprobe_1_jess_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/jess/added_IVF12_Flat_nprobe_1_jess_v2.index
|
assets/indices/peter_IVF39_Flat_nprobe_1_peter_v2.index
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
logs/peter/added_IVF39_Flat_nprobe_1_peter_v2.index
|
assets/weights/carol.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2d66443b8733084d45bbf58b84eeeb4ad53ace2907c02a40aaa1a13b468822f2
|
3 |
+
size 55187206
|
assets/weights/daryl.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab05a09c230f190b149d3c71d24d9258becdee1079ce226e77daefe44ee8d243
|
3 |
+
size 55210579
|
assets/weights/elmo.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d259715b2e8c46b8cc59349769e24856cfa57a8ad85ff296a6b741916d114ccb
|
3 |
+
size 55186681
|
assets/weights/francis.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ad5b27c6ad3751299f8bbee318e0e1e10a3cbf8b08d66150a584c29b0bb5509c
|
3 |
+
size 55216800
|
assets/weights/harry.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e8c2df897b6181994e4289a027e3228790a827dcbfdc6a8fd803519670d1dbf
|
3 |
+
size 55187206
|
assets/weights/jess.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c5a777b7d7d7a2abd23a938a164ce668c735110a33281519d949883dfceadbd0
|
3 |
+
size 55186681
|
assets/weights/peter.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab3f370dd46d0d90b7df4adb3791f035f43998f0b051b61e37c5f97e88eae793
|
3 |
+
size 55187206
|
constant.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from glob import glob
|
2 |
+
import os
|
3 |
+
|
4 |
+
weight_files = glob('assets/weights/*', recursive=True)
|
5 |
+
indices_files = glob('assets/indices/*', recursive=True)
|
6 |
+
|
7 |
+
main_directory = "https://huggingface.co/spaces/darylfunggg/rvc-spleeter-voice/resolve/main/"
|
8 |
+
|
9 |
+
weights = {'custom': None}
|
10 |
+
for weight_file in weight_files:
|
11 |
+
weights[os.path.splitext(os.path.basename(weight_file))[0]] = f"{main_directory}{weight_file}"
|
12 |
+
|
13 |
+
|
14 |
+
indices = {'custom': None}
|
15 |
+
for indices_file in indices_files:
|
16 |
+
indices[os.path.basename(indices_file).split("_")[0]] = f"{main_directory}{indices_file}"
|
17 |
+
|
18 |
+
|
19 |
+
assert len(weights) == len(indices)
|