# Cyberpunk 2077에 나온 실시간 번역 구현해보기

> Clean Markdown view of GeekNews topic #8125. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=8125](https://news.hada.io/topic?id=8125)
- GeekNews Markdown: [https://news.hada.io/topic/8125.md](https://news.hada.io/topic/8125.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-12-28T10:29:07+09:00
- Updated: 2022-12-28T10:29:07+09:00
- Original source: [github.com/elanmart](https://github.com/elanmart/cbp-translate)
- Points: 18
- Comments: 1

## Topic Body

- 게임에서 캐릭터가 외국어로 얘기하면, 그 캐릭터의 머리위에 원래 언어로 자막을 보여준 후 실시간으로 자신의 언어로 번역됨  
- 이 기능을 DL 음성인식/얼굴인식등을 이용해서 구현해 본 코드와 동작방식 상세 소개   
- OpenAI Whisper + NVDIA NeMo + DeepL + RetinaFace + DeepFace + Sckikit-learn + Gradio + Modal + PIL/OpenCV + ffpmpeg  
### 동작방식   
- yt-dlp 로 유튜브 영상을 다운 받음   
- ffmpeg 으로 영상/음성 분리   
- 음성은   
  - Whisper 에 넣어서 Transcripts 생성하고 DeepL로 번역   
  - NeMo 에 넣어서 스피커ID(말하는사람) 추출   
  - 두가지를 Timestamp 기반으로 매칭 시켜서 스피커 ID가 붙은 텍스트를 생성   
- 영상은   
  - MTCNN/RetinaFace로 얼굴 위치를 추출. Modal로 병렬화해서 빠르게.  
  - DeepFace/Scikit-Learn 으로 각 얼굴에 임베딩 추출하고 유니크 ID 부여   
- Jaccard Index로 FaceID 와 SpeakerID 매칭   
- 만들어진 프레임 메타데이터로 PIL/OpenCV로 프레임에 어노테이션 달기   
- ffmpeg Writer로 영상 생성

## Comments



### Comment 13901

- Author: chicol
- Created: 2022-12-28T14:39:42+09:00
- Points: 1

동작 방식 설계가 기깔나네요.
