hecko
10/02/2022, 6:13 PMhecko
10/02/2022, 6:14 PMhecko
10/02/2022, 6:20 PMhecko
10/02/2022, 6:21 PMhecko
10/02/2022, 6:21 PMLexi (delulu posts on the daily)
10/02/2022, 6:22 PMhecko
10/02/2022, 6:23 PMhecko
10/02/2022, 6:23 PMpy
# insert imports and definitions and such from above
from numpy.linalg import norm
test_embedding = classifier.encode_batch(torchaudio.load("untitled.wav")[0]).squeeze().tolist()
with TinyDB(data_path, storage = CachingMiddleware(JSONStorage)) as db:
voices = [{**i, "distance": norm(numpy.array(i["avg_embedding"]) - numpy.array(test_embedding))} for i in db.all() if type(i["avg_embedding"]) == list]
print("\n".join([f"{i['name']} - {i['distance']}" for i in sorted(voices, key = lambda x: x["distance"])[:10]]))
hecko
10/02/2022, 6:24 PMhecko
10/02/2022, 6:25 PMhecko
10/02/2022, 6:25 PMLexi (delulu posts on the daily)
10/02/2022, 6:28 PMLexi (delulu posts on the daily)
10/02/2022, 6:29 PMhecko
10/02/2022, 6:29 PMhecko
10/02/2022, 6:29 PMhecko
10/02/2022, 6:30 PMhecko
10/02/2022, 6:30 PM{K EY1} (Kei)
10/04/2022, 2:15 PM{K EY1} (Kei)
10/04/2022, 2:18 PMhecko
10/04/2022, 3:21 PM{K EY1} (Kei)
10/04/2022, 4:02 PMzwf
10/04/2022, 4:11 PMhecko
10/04/2022, 4:24 PMhecko
10/04/2022, 4:25 PMhecko
10/04/2022, 4:26 PMhecko
10/04/2022, 4:26 PMembeddings
has 4 elements, vs avg_embedding
which is what i actually use for the distance calculationhecko
10/04/2022, 4:28 PMnull
and nan
respectively because the voice for it had no sample audioCouch
10/04/2022, 4:32 PMmega b
10/05/2022, 2:01 AMmega b
10/05/2022, 2:01 AM