Real-Time Live Captions and Translation with StreamlitReal-Time Live Captions and Translation with Streamlit
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
🎙️ Live Captions + Translation: real-time speech-to-text with instant translation.
I built a Streamlit web app that listens to your microphone, shows live captions as you speak, and translates them into another language in real time.
How it works: 1️⃣ Mic stream: streamlit-webrtc captures live audio frames in the browser. 2️⃣ Speech-to-text: Kyutai’s 2.6B-parameter STT model (Hugging Face Transformers) turns the audio into English text. 3️⃣ New-word detection: only newly spoken words are sent for translation, so the app doesn’t re-translate the whole caption every time. 4️⃣ Translation: Meta’s NLLB-200 (600M) model translates into any of 200 languages. Hindi is the default.
Engineering highlights: • Models load once and stay cached (st.cache_resource), so the app responds quickly. • Runs on GPU in float16 when available and falls back to CPU. • Switching the target language takes one setting change.
Use cases: meetings, lectures, accessibility for hearing-impaired users, and multilingual conversations.
Tech: Python · PyTorch · Hugging Face Transformers · Streamlit · WebRTC 🔗 github.com/bns218/live_caption_app
Post image
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started