speaker-detector 0.1.4__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- speaker_detector/export_embeddings.py +21 -0
- {speaker_detector-0.1.4.dist-info → speaker_detector-0.1.5.dist-info}/METADATA +1 -1
- {speaker_detector-0.1.4.dist-info → speaker_detector-0.1.5.dist-info}/RECORD +6 -6
- {speaker_detector-0.1.4.dist-info → speaker_detector-0.1.5.dist-info}/WHEEL +0 -0
- {speaker_detector-0.1.4.dist-info → speaker_detector-0.1.5.dist-info}/entry_points.txt +0 -0
- {speaker_detector-0.1.4.dist-info → speaker_detector-0.1.5.dist-info}/top_level.txt +0 -0
@@ -39,3 +39,24 @@ def export_embeddings_to_json(pt_path, json_path):
|
|
39
39
|
json.dump(converted, f, indent=2)
|
40
40
|
|
41
41
|
print(f"✅ Exported {len(converted)} speaker embeddings to {json_path}")
|
42
|
+
|
43
|
+
def load_embeddings_from_json(json_path, embeddings_dir):
|
44
|
+
"""Load speaker embeddings directly from uploaded JSON format."""
|
45
|
+
with open(json_path, "r") as f:
|
46
|
+
speakers = json.load(f)
|
47
|
+
|
48
|
+
if not isinstance(speakers, list):
|
49
|
+
raise ValueError("Expected a list of speaker records in speakers.json")
|
50
|
+
|
51
|
+
for entry in speakers:
|
52
|
+
speaker_id = entry.get("label")
|
53
|
+
vector = entry.get("vector")
|
54
|
+
|
55
|
+
if speaker_id and isinstance(vector, list):
|
56
|
+
emb_path = embeddings_dir / f"{speaker_id}.pt"
|
57
|
+
torch.save(torch.tensor(vector), emb_path)
|
58
|
+
print(f"✅ Loaded embedding for {speaker_id} → {emb_path}")
|
59
|
+
else:
|
60
|
+
print(f"⚠️ Skipping invalid speaker record: {entry}")
|
61
|
+
|
62
|
+
|
@@ -5,11 +5,11 @@ speaker_detector/analyze.py,sha256=sA8qyzczdHUbJw2_1JIbXn1WpiKC5dHLPRtPPoppJzY,1
|
|
5
5
|
speaker_detector/cli.py,sha256=TKci4o4Fru-3NqUkPDRQRvtis2niNEAh9sQWwE5t6Us,3521
|
6
6
|
speaker_detector/combine.py,sha256=yCiqG6VMojz0CxSTPqjx0RrUban8oFIcKlA1zFMzaU4,761
|
7
7
|
speaker_detector/core.py,sha256=lQNOcmZs2IJOqrNKlk1BeVQX6tzc7BSpeP5Gordff-E,3586
|
8
|
-
speaker_detector/export_embeddings.py,sha256=
|
8
|
+
speaker_detector/export_embeddings.py,sha256=PJtj_tdas595fnjRybnyCVMG7T84-xgDYPp7eKvpKnw,1922
|
9
9
|
speaker_detector/export_model.py,sha256=qVVT2wSCnsPA8pSAEEyIMkY7Kc8uAgepc03MxBMT3xU,1146
|
10
10
|
speaker_detector/generate_summary.py,sha256=oTWEf2bxTCRIUl8L17-J64FyhRbCPnDjihFluEnBWc8,3726
|
11
|
-
speaker_detector-0.1.
|
12
|
-
speaker_detector-0.1.
|
13
|
-
speaker_detector-0.1.
|
14
|
-
speaker_detector-0.1.
|
15
|
-
speaker_detector-0.1.
|
11
|
+
speaker_detector-0.1.5.dist-info/METADATA,sha256=NJazUcFKkbwoUCSFgfGDT7rjs8cbHqpCG26Y3RQ5zUs,4564
|
12
|
+
speaker_detector-0.1.5.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
13
|
+
speaker_detector-0.1.5.dist-info/entry_points.txt,sha256=2B30ee2cTyeeA49x_TBURl53bDRiLWGK3NWhb9rlK3s,63
|
14
|
+
speaker_detector-0.1.5.dist-info/top_level.txt,sha256=PJ5rfvd3GAbzMbc7-Fwhtufjf6HxzzTiiHociOy7RiM,17
|
15
|
+
speaker_detector-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|