Sussurro
Introdução
Este caderno foi traduzido automaticamente para tornĂĄ-lo acessĂvel a mais pessoas, por favor me avise se vocĂȘ vir algum erro de digitação..
O Whisper Ă© um sistema de reconhecimento automĂĄtico da fala (ASR) treinado em 680.000 horas de dados supervisionados multilĂngues e multitarefa coletados da web. O uso de um conjunto de dados tĂŁo grande e diversificado leva a uma maior robustez dos sotaques, do ruĂdo de fundo e da linguagem tĂ©cnica. AlĂ©m disso, permite a transcrição em vĂĄrios idiomas, assim como a tradução desses idiomas para o inglĂȘs.
Instalação
A fim de instalar esta ferramenta Ă© melhor criar um novo ambiente anaconda.
!conda create -n whisper
Entramos no meio ambiente
!conda create -n whisper!conda activate whisper
Instalamos todos os pacotes necessĂĄrios
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia
Finalmente, instalamos o whisper
.
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git
E nĂłs atualizamos ffmpeg
.
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git!sudo apt update && sudo apt install ffmpeg
Uso
Importamos "sussurros".
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git!sudo apt update && sudo apt install ffmpegimport whisper
Selecionamos o modelo, quanto maior, melhor ele farĂĄ.
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git!sudo apt update && sudo apt install ffmpegimport whisper# model = "tiny"# model = "base"# model = "small"# model = "medium"model = "large"model = whisper.load_model(model)
Fizemos o upload do ĂĄudio deste antigo (1987) anĂșncio da Micro Machines.
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git!sudo apt update && sudo apt install ffmpegimport whisper# model = "tiny"# model = "base"# model = "small"# model = "medium"model = "large"model = whisper.load_model(model)audio_path = "MicroMachines.mp3"audio = whisper.load_audio(audio_path)audio = whisper.pad_or_trim(audio)
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git!sudo apt update && sudo apt install ffmpegimport whisper# model = "tiny"# model = "base"# model = "small"# model = "medium"model = "large"model = whisper.load_model(model)audio_path = "MicroMachines.mp3"audio = whisper.load_audio(audio_path)audio = whisper.pad_or_trim(audio)mel = whisper.log_mel_spectrogram(audio).to(model.device)
!conda create -n whisper!conda activate whisper!conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia!pip install git+https://github.com/openai/whisper.git!sudo apt update && sudo apt install ffmpegimport whisper# model = "tiny"# model = "base"# model = "small"# model = "medium"model = "large"model = whisper.load_model(model)audio_path = "MicroMachines.mp3"audio = whisper.load_audio(audio_path)audio = whisper.pad_or_trim(audio)mel = whisper.log_mel_spectrogram(audio).to(model.device)_, probs = model.detect_language(mel)print(f"Detected language: {max(probs, key=probs.get)}")
Detected language: en
options = whisper.DecodingOptions()result = whisper.decode(model, mel, options)
options = whisper.DecodingOptions()result = whisper.decode(model, mel, options)result.text
"This is the Micro Machine Man presenting the most midget miniature motorcade of micro machines. Each one has dramatic details, terrific trim, precision paint jobs, plus incredible micro machine pocket play sets. There's a police station, fire station, restaurant, service station, and more. Perfect pocket portables to take any place. And there are many miniature play sets to play with and each one comes with its own special edition micro machine vehicle and fun fantastic features that miraculously move. Raise the boat lift at the airport, marina, man the gun turret at the army base, clean your car at the car wash, raise the toll bridge. And these play sets fit together to form a micro machine world. Micro machine pocket play sets so tremendously tiny, so perfectly precise, so dazzlingly detailed, you'll want to pocket them all. Micro machines and micro machine pocket play sets sold separately from Galoob. The smaller they are, the better they are."