深度学习系列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

相关推荐
星野云联AIoT技术洞察4 天前
2025年语音识别(ASR)与语音合成(TTS)技术趋势分析对比
whisper·语音识别·模型部署·tts·asr·嵌入式ai·naturalspeech3
共绩算力9 天前
OpenAI Whisper 语音识别模型:技术与应用全面分析
人工智能·whisper·语音识别·共绩算力
人工智能技术派11 天前
Whisper推理源码解读
人工智能·语言模型·whisper·语音识别
luoyayun36115 天前
PySide6调用OpenAI的Whisper模型进行语音ASR转写
whisper·pyside6·asr
学习是生活的调味剂15 天前
PEFT实战LoRA微调OpenAI Whisper 中文语音识别
人工智能·whisper·语音识别
qq74223498420 天前
语音识别:PyAudio、SoundDevice、Vosk、openai-whisper、Argos-Translate、FunASR(Python)
python·whisper·语音识别
AI_Gump21 天前
WhisperLiveKit上手及主观评测
人工智能·whisper
biubiubiu070621 天前
faster-whisper + FastAPI安装
whisper
cwll200921 天前
使用ffmpeg8.0的whisper模块语音识别
人工智能·whisper·语音识别
小小ken21 天前
whisper-large-v3部署详细步骤,包括cpu和gpu方式,跟着做一次成功
ffmpeg·whisper·语音识别