Skip to content

Commit 15c3392

Browse files
committed
added SPIN v2 embedder
1 parent 60d11b9 commit 15c3392

15 files changed

Lines changed: 22 additions & 0 deletions

File tree

core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ def parse_arguments():
776776
choices=[
777777
"contentvec",
778778
"spin",
779+
"spin-v2",
779780
"chinese-hubert-base",
780781
"japanese-hubert-base",
781782
"korean-hubert-base",
@@ -1287,6 +1288,7 @@ def parse_arguments():
12871288
choices=[
12881289
"contentvec",
12891290
"spin",
1291+
"spin-v2",
12901292
"chinese-hubert-base",
12911293
"japanese-hubert-base",
12921294
"korean-hubert-base",
@@ -1771,6 +1773,7 @@ def parse_arguments():
17711773
choices=[
17721774
"contentvec",
17731775
"spin",
1776+
"spin-v2",
17741777
"chinese-hubert-base",
17751778
"japanese-hubert-base",
17761779
"korean-hubert-base",
@@ -1911,6 +1914,7 @@ def parse_arguments():
19111914
choices=[
19121915
"contentvec",
19131916
"spin",
1917+
"spin-v2",
19141918
"chinese-hubert-base",
19151919
"japanese-hubert-base",
19161920
"korean-hubert-base",
447 KB
Binary file not shown.

logs/mute_spin-v2/f0/mute.wav.npy

1.3 KB
Binary file not shown.
2.48 KB
Binary file not shown.
188 KB
Binary file not shown.
234 KB
Binary file not shown.
281 KB
Binary file not shown.
93.8 KB
Binary file not shown.

logs/reference/create_reference.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def cf0(f0):
4141
spin_path = r"rvc\models\embedders\spin"
4242
spin_model = HubertModel.from_pretrained(spin_path)
4343

44+
spin2_path = r"rvc\models\embedders\spin-v2"
45+
spin2_model = HubertModel.from_pretrained(spin2_path)
46+
4447
feats = torch.from_numpy(audio).to(torch.float32).to("cpu")
4548
feats = torch.nn.functional.pad(feats.unsqueeze(0), (40, 40), mode="reflect")
4649
feats = feats.view(1, -1)
@@ -53,7 +56,13 @@ def cf0(f0):
5356
spin_feats = spin_model(feats)["last_hidden_state"]
5457
spin_feats = spin_feats.squeeze(0).float().cpu().numpy()
5558
print("spin", spin_feats.shape)
59+
60+
spin2_feats = spin2_model(feats)["last_hidden_state"]
61+
spin2_feats = spin2_feats.squeeze(0).float().cpu().numpy()
62+
print("spin-v2", spin2_feats.shape)
63+
5664
np.save(r"logs\reference\contentvec\feats.npy", cv_feats)
5765
np.save(r"logs\reference\spin\feats.npy", spin_feats)
66+
np.save(r"logs\reference\spin-v2\feats.npy", spin2_feats)
5867
np.save(r"logs\reference\pitch_coarse.npy", f0c)
5968
np.save(r"logs\reference\pitch_fine.npy", f0)

logs/reference/spin-v2/feats.npy

5.11 MB
Binary file not shown.

0 commit comments

Comments
 (0)