무향향수

[Whisper] Whisper를 활용하여 STT 구현하기 본문

kt aivle

[Whisper] Whisper를 활용하여 STT 구현하기

튼튼한장 2024. 6. 27. 15:55

Speech to Text 구현하기

(사실 모든 티스토리 유튜브 등 사이트를 활용해서 뭐가 맞는지 잘못되었는지 정확히는 알 수 없다..ㅎㅎ)

 

1. Python 설치

참고한 유튜브에서는 3.10.10 사용을 권장하였지만 아나콘다를 삭제 후 재설치하였더니 제대로 작동하였다.

 

2. CUDA 및 PyTorch 설치

Pytorch: https://pytorch.org/get-started/locally/

 

Start Locally

Start Locally

pytorch.org

 

CUDA: https://developer.nvidia.com/cuda-toolkit-archive

 

CUDA Toolkit Archive

Previous releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production

developer.nvidia.com

 

 

3. ffmpeg 설치

ffmpeg를 설치하기 전에 Chocolatey CLI를 설치한 후 choco 명령어를 사용해 ffmpeg를 설치한다.

 

Chocolately CLI 설치1) 관리자 권한으로 명령 프롬프트를 연다.2) 다음을 복사해서 명령 프롬프트에 붙여 넣는다.

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

 

설치 후 아래 명령어를 실행하여 ffmpeg를 설치한다.

 

choco install ffmpeg

 

 

4. Whsiper 설치

pip install -U openai-whsiper

 

 

5. Whisper CLI 사용

아래 코드를 실행하면 해당 파일의 자막을 작성해준다.

whisper "파일명"

 


더보기

느낀점

이거 하나 해보겠다고 9시부터 4시까지 오류란 오류는 다 마주하면서 자료를 찾아다녔다.

너무 힘들었고 똑같은 오류가 뜨는데 해결할 수 없고, 원인도 알 수 없다는 점이 특히 힘들었다.

다음에는 파일의 음성을 텍스트로 만드는 것에서 추가로 실시간 음성을 텍스트로 변경하도록 수정할 것이다.

화이팅~!

 

참고 사이트 

 

7. Whisper

주요 수정 이력: | 날짜 | 변경 사항 | | --- | --- | | 2023. 5. 27. | 최초 작성 | | 2023. 10. 20. | 설치 방법 추가 | | 20…

wikidocs.net

 

참고 영상

 

🔎 youtube whisper openai: Google 검색

 

www.google.com