speaker-detector 0.1.3__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.
@@ -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
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: speaker-detector
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: A CLI tool for speaker enrollment and identification using SpeechBrain.
5
5
  Author-email: Lara Whybrow <lara.whybrow@gmail.com>
6
6
  License: MIT
@@ -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=OxNXadzEiMEJgpmCG6HHFncUX7DumFvTOys1R6UMUnw,1151
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.3.dist-info/METADATA,sha256=ilNHpXunmGzuyDUxadMHolzhHX2aNjsOBWZe8mHDgQc,4564
12
- speaker_detector-0.1.3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
13
- speaker_detector-0.1.3.dist-info/entry_points.txt,sha256=2B30ee2cTyeeA49x_TBURl53bDRiLWGK3NWhb9rlK3s,63
14
- speaker_detector-0.1.3.dist-info/top_level.txt,sha256=PJ5rfvd3GAbzMbc7-Fwhtufjf6HxzzTiiHociOy7RiM,17
15
- speaker_detector-0.1.3.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5