nonmetal commited on
Commit
25bb09b
·
0 Parent(s):

KyaraEmbed v1.0

Browse files
Files changed (6) hide show
  1. .gitattributes +35 -0
  2. LICENSE-MODEL +32 -0
  3. NOTICE +13 -0
  4. README.md +81 -0
  5. kyaraembed_v1.0.pt +3 -0
  6. kyaraembed_v1.0.pt.sha256 +1 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
LICENSE-MODEL ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ KyaraEmbed v1.0 model licence
2
+
3
+ Copyright (c) 2026 the KyaraBench authors
4
+
5
+ The KyaraEmbed checkpoint is licensed under the Creative Commons
6
+ Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
7
+
8
+ Summary: https://creativecommons.org/licenses/by-nc/4.0/
9
+ Full text: https://creativecommons.org/licenses/by-nc/4.0/legalcode
10
+
11
+ You may share and adapt the checkpoint, including for academic and personal
12
+ research, provided you give appropriate credit, link to the licence, and
13
+ indicate whether you made changes. Commercial use is not granted by this
14
+ licence.
15
+
16
+ WHY NON-COMMERCIAL
17
+
18
+ Part of the audio the checkpoint was fine-tuned on is held under terms that
19
+ permit non-commercial research only. This licence carries that restriction
20
+ forward rather than granting rights the training data does not support:
21
+
22
+ - Anim-400K is distributed by the Berkeley AI Research Lab for approved
23
+ non-commercial scientific or research use.
24
+ - The tri-jek corpus permits non-commercial research; its authors handle
25
+ commercial arrangements separately.
26
+
27
+ If you need the checkpoint for a commercial purpose, the rights have to be
28
+ settled with the holders of those corpora, not here.
29
+
30
+ ATTRIBUTION CHAIN
31
+
32
+ See NOTICE for the upstream licences this checkpoint inherits.
NOTICE ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ KyaraEmbed v1.0 is a derivative of two upstream models. Their licences require these notices to
2
+ travel with any copy or substantial portion of the weights.
3
+
4
+ 1. speechbrain/spkrec-ecapa-voxceleb -- Apache License 2.0
5
+ https://huggingface.co/speechbrain/spkrec-ecapa-voxceleb
6
+
7
+ 2. litagin/anime_speaker_embedding_ecapa_tdnn_groupnorm -- MIT License
8
+ https://huggingface.co/litagin/anime_speaker_embedding_ecapa_tdnn_groupnorm
9
+
10
+ Modification made here: the weights of (2) were fine-tuned for 1,500 steps. The architecture is
11
+ unchanged.
12
+
13
+ The KyaraEmbed weights are released under CC BY-NC 4.0; see LICENSE-MODEL.
README.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ base_model: litagin/anime_speaker_embedding_ecapa_tdnn_groupnorm
4
+ pipeline_tag: audio-classification
5
+ tags:
6
+ - speaker-verification
7
+ - character-identity
8
+ - cross-lingual
9
+ - anime
10
+ - speech
11
+ language:
12
+ - ja
13
+ - en
14
+ ---
15
+
16
+ # KyaraEmbed
17
+
18
+ An encoder for anime **character** identity rather than speaker identity. Given an audio clip, it
19
+ returns a 192-dimensional embedding whose cosine similarity follows the character across a change
20
+ of performer, and separates characters who share one.
21
+
22
+ Fine-tuned from a public anime-domain ECAPA-TDNN. Evaluation numbers and the benchmark this was
23
+ built for live in the [KyaraBench repository](https://github.com/sizigi/kyarabench).
24
+
25
+ ## Checkpoint
26
+
27
+ | File | Size | Notes |
28
+ |---|---|---|
29
+ | `kyaraembed_v1.0.pt` | 83 MB | ECAPA-TDNN, 20.8M parameters, 192-d output |
30
+ | `kyaraembed_v1.0.pt.sha256` | — | Checksum |
31
+ | `LICENSE-MODEL`, `NOTICE` | — | Licence and the upstream attribution chain |
32
+
33
+ ## How to use
34
+
35
+ ```bash
36
+ pip install torch soundfile librosa anime-speaker-embedding
37
+ ```
38
+
39
+ ```python
40
+ import numpy as np, torch, soundfile as sf, librosa
41
+ from anime_speaker_embedding import AnimeSpeakerEmbedding
42
+
43
+ device = "cuda" if torch.cuda.is_available() else "cpu"
44
+ model = AnimeSpeakerEmbedding(device=device, variant="char")
45
+ model.load_state_dict(torch.load("kyaraembed_v1.0.pt", map_location=device))
46
+ model.eval()
47
+
48
+ def load(path, seconds=10.0, sr=16000):
49
+ """Mono 16 kHz at a fixed length: longer is truncated, shorter is zero-padded."""
50
+ wav, file_sr = sf.read(path, dtype="float32", always_2d=True)
51
+ wav = wav.mean(axis=1)
52
+ if file_sr != sr:
53
+ wav = librosa.resample(wav, orig_sr=file_sr, target_sr=sr)
54
+ out = np.zeros(int(seconds * sr), dtype="float32")
55
+ wav = wav[:len(out)]
56
+ out[:len(wav)] = wav
57
+ return out
58
+
59
+ x = torch.from_numpy(np.stack([load("a.wav"), load("b.wav")])).to(device)
60
+ with torch.no_grad():
61
+ z = torch.nn.functional.normalize(model(x).squeeze(1), dim=-1)
62
+ print(f"similarity: {float(z[0] @ z[1]):.3f}")
63
+ ```
64
+
65
+ Keep the fixed length. The encoder pools over time, so padding a clip to whatever else happens to
66
+ be in its batch changes its embedding; padding to a fixed length does not.
67
+
68
+ For several clips per side, mean-pool the normalised embeddings and renormalise before the cosine:
69
+
70
+ ```python
71
+ def prototype(paths):
72
+ x = torch.from_numpy(np.stack([load(p) for p in paths])).to(device)
73
+ with torch.no_grad():
74
+ z = torch.nn.functional.normalize(model(x).squeeze(1), dim=-1)
75
+ return torch.nn.functional.normalize(z.mean(0), dim=-1)
76
+ ```
77
+
78
+ ## Licence
79
+
80
+ CC BY-NC 4.0. Part of the audio behind these weights is held under terms permitting
81
+ non-commercial research only. See `LICENSE-MODEL` and `NOTICE`.
kyaraembed_v1.0.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72939e1955750834f6a6168d5b18f22d52a1a6344bc6eaeb452a1d730fc13694
3
+ size 83125959
kyaraembed_v1.0.pt.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ 72939e1955750834f6a6168d5b18f22d52a1a6344bc6eaeb452a1d730fc13694 kyaraembed_v1.0.pt