Skriptida ishlatishingiz mumkin: from deep speaker import deep speaker


Download 22.46 Kb.
bet1/3
Sana18.06.2023
Hajmi22.46 Kb.
#1578255
  1   2   3
Bog'liq
otp token va tovushni tanish


Python-da ovozni tanishlash va tasdiqlash uchun "Speaker Verification" yoki "Speaker Recognition" ga oid kutubxonalardan foydalanishingiz mumkin. Bu kutubxonalardan ba'zilari:

DeepSpeaker: https://github.com/philipperemy/deep-speaker


SpeakerRecognition: https://github.com/ananthkk1995/SpeakerRecognition
Bu kutubxonalardan birini tanlashdan so'ng, foydalanuvchi tovush xabarlari asosida ovozni tanishlashni o'rganishingiz kerak. Ovozning biometrik belgilarini olish va foydalanuvchi identifikatsiyasini aniqlash uchun u erda ishlatiladigan modelni o'rganishingiz kerak.

DeepSpeaker kutubxonasidan foydalanish uchun quyidagi qadamlarni bajarishingiz mumkin:


1.DeepSpeaker kutubxonasini o'rnatish:
pip install deep-speaker
2.DeepSpeaker modelini yuklab olish:
DeepSpeaker kutubxonasining boshqa ishlatiladigan qismida tayyorlangan model mavjud. Ushbu modelni yuklab olish uchun quyidagi komandani bajaring:
wget -O deep_speaker.zip "https://github.com/philipperemy/deep-speaker/raw/master/encoder_model.h5"
unzip deep_speaker.zip
3.Python skriptida ovozni tanishlash va tasdiqlashni amalga oshirish:
Quyidagi kodni Python skriptida ishlatishingiz mumkin:
from deep_speaker import deep_speaker

# Ovozning tanishlash uchun deep_speaker modelini yaratish
model = deep_speaker.create_model()

# Modelni yuklab olish
model.load_weights('encoder_model.h5')

# Foydalanuvchi ovozini tanishlash uchun
def recognize_speaker(voice_path, enrollment_path):
# Foydalanuvchi ovozini kodlash
voice_embedding = deep_speaker.embed_speaker(model, voice_path)
# Tanishlash uchun to'lovchi ovozning kodini yaratish
enrollment_embedding = deep_speaker.embed_speaker(model, enrollment_path)
# Ovozlar orasidagi masofani hisoblash
distance = deep_speaker.cosine_distance(voice_embedding, enrollment_embedding)

Download 22.46 Kb.

Do'stlaringiz bilan baham:
  1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling