深度学习系列56:使用whisper进行语音转文字

1. openai-whisper

这应该是最快的使用方式了。安装pip install -U openai-whisper,接着安装ffmpeg,随后就可以使用了。模型清单如下:

第一种方式,使用命令行:

复制代码
whisper japanese.wav --language Japanese  --model medium

另一种方式,使用python调用:

复制代码
import whisper
model = whisper.load_model("base")
result = model.transcribe("audio.mp3",initial_prompt='以下是普通话的句子。')
print(result["text"])

2. faster-whisper

安装也一样:pip install -U faster-whisper,速度对比:

3. whisper-jax

在GPU上的加速版本

首先安装库:

pip install jax jaxlib git+https://github.com/sanchit-gandhi/whisper-jax.git datasets soundfile librosa

调用代码为:

复制代码
from whisper_jax import FlaxWhisperPipline
import jax.numpy as jnp
pipeline = FlaxWhisperPipline("openai/whisper-tiny", dtype=jnp.bfloat16, batch_size=16)
%time text = pipeline('test.mp3')

4. whisper-openvino

在intel系列的cpu上加速的版本:

安装库:pip install git+https://github.com/zhuzilin/whisper-openvino.git

调用方法:whisper carmack.mp3 --model tiny.en --beam_size 3

相关推荐
Encarta19936 天前
【语音识别】vLLM 部署 Whisper 语音识别模型指南
人工智能·whisper·语音识别
JHC0000006 天前
ubuntu 下调用系统麦克风,以及faster-whisper-medium 处理音频转写文本
ubuntu·whisper·音视频
西西弗Sisyphus8 天前
whisper 语音识别
whisper·语音识别
JHC0000008 天前
docker 中跑faster-whisper 教程(1050显卡)
docker·容器·whisper·语音识别
engchina16 天前
vLLM 部署 openai whisper 模型实现语音转文字
人工智能·python·whisper
gs8014016 天前
Faster-Whisper —— 为语音识别加速的利器
人工智能·whisper·语音识别
charles_vaez22 天前
开源模型应用落地-语音转文本-whisper模型-AIGC应用探索(五)
深度学习·whisper·aigc
Mark White1 个月前
开箱即用的whisper-service服务
whisper
Python数据分析与机器学习1 个月前
基于fast-whisper模型的语音识别工具的设计与实现
大数据·人工智能·python·搜索引擎·whisper·语音识别·课程设计
不喝可乐_2 个月前
在win11 中 whisper-large-v3-turbo 的简单使用
whisper