Skip to main content

Parrots, Automatic Speech Recognition(**ASR**), Text-To-Speech(**TTS**) toolkit

Project description

🇨🇳中文 | 🌐English | 📖文档/Docs | 🤖模型/Models


Parrots: ASR and TTS toolkit

PyPI version Downloads Contributions welcome GitHub contributors License Apache 2.0 python_vesion GitHub issues Wechat Group

Introduction

Parrots, Automatic Speech Recognition(ASR), Text-To-Speech(TTS) toolkit, support Chinese, English, Japanese, etc.

parrots实现了语音识别和语音合成模型一键调用,开箱即用,支持中英文。

Features

  1. ASR:基于distilwhisper实现的中文语音识别(ASR)模型,支持中、英等多种语言
  2. TTS:基于GPT-SoVITS训练的语音合成(TTS)模型,支持中、英、日等多种语言

Install

pip install -r requirements.txt
pip install parrots

or

git clone https://github.com/shibing624/parrots.git
cd parrots
python setup.py install

Demo

Official Demo: https://www.mulanai.com/product/asr/

Usage

ASR

example: examples/demo_asr.py

import os
import sys

sys.path.append('..')
from parrots import SpeechRecognition

pwd_path = os.path.abspath(os.path.dirname(__file__))

if __name__ == '__main__':
    m = SpeechRecognition()
    r = m.recognize_speech_from_file(os.path.join(pwd_path, 'tushuguan.wav'))
    print('[提示] 语音识别结果:', r)

output:

{'text': '北京图书馆'}

TTS(Speech Synthesis)

example: examples/demo_tts.py

import sys

sys.path.append('..')
from parrots import TextToSpeech
m = TextToSpeech(
    speaker_model_path="shibing624/parrots-gpt-sovits-speaker-maimai",
    speaker_name="MaiMai",
    device="cpu",
    half=False
)
m.predict(
    text="你好,欢迎来北京。welcome to the city.",
    text_language="auto",
    output_path="output_audio.wav"
)

output:

Save audio to output_audio.wav

Contact

  • Issue(建议):GitHub issues
  • 邮件我:xuming: xuming624@qq.com
  • 微信我:加我微信号:xuming624, 进Python-NLP交流群,备注:姓名-公司名-NLP

Citation

如果你在研究中使用了parrots,请按如下格式引用:

@misc{parrots,
  title={parrots: ASR and TTS Tool},
  author={Ming Xu},
  year={2024},
  howpublished={\url{https://github.com/shibing624/parrots}},
}

License

授权协议为 The Apache License 2.0,可免费用做商业用途。请在产品说明中附加parrots的链接和授权协议。

Contribute

项目代码还很粗糙,如果大家对代码有所改进,欢迎提交回本项目,在提交之前,注意以下两点:

  • tests添加相应的单元测试
  • 使用python -m pytest来运行所有单元测试,确保所有单测都是通过的

之后即可提交PR。

Reference

ASR

TTS(Speech Synthesis)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parrots-1.0.1.tar.gz (5.3 MB view details)

Uploaded Source

File details

Details for the file parrots-1.0.1.tar.gz.

File metadata

  • Download URL: parrots-1.0.1.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for parrots-1.0.1.tar.gz
Algorithm Hash digest
SHA256 17bf7b8e6a03f64ab39764d7189078c96bcd39dae08bb0b6360a9a8b29fa7ca2
MD5 a28ac01b73875d67b3b1cb67470d4f69
BLAKE2b-256 06d2f56f12a81b8154ac332283618b256e9395064c90792503b134a8ba6be5ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page