Make anyone sound naughty / funny with Python.
Bleep out keywords of your choice from an mp4 by leveraging a transcription model (here Whisper) to transcribe the audio, then target and replace chosen words with bleep sounds using the extracted timestamps associated with your chosen word(s).
All processing is performed locally - see the streamlit app (setup below) and detailed walkthrough notebook (see beep_that_sht_walkthrough.ipynb
) to play / see nitty gritty details. Click to try out this toy app directly in your browser. WARNING: the machine this Space is running on is pretty small - so use it to try out shorter (<2min) videos.
Some examples of the end product (make sure to turn volume on, its off by default).
bleep-that-sht-examples.mp4
Let's look more closely at the last example above - below is a short clip we'll bleep out some words from using the pipeline in this repo. (make sure to turn on audio - its off by default)
bleep_test_og_cropped_low_res.mp4
Now the same clip with the words - "treetz", "ice", "cream", "chocolate", "syrup", and "cookie" - bleeped out
bleep_test_processed_cropped_low_res.mp4
To get setup to run the notebook / bleep your own videos / run the strealit demo first install the requirements for this project by pasting the below in your terminal.
pip install -r requirements.streamlit
To install requirements for the gradio demo use this install
pip install -r requirements.gradio
You will need ffmpeg installed on your machine as well.
Start this streamlit demo locally that lets you enter in a youtube / shorts url to a video you wish to bleep
python -m streamlit run bleep_that_sht/app_url_download.py
Alternatively you can start a gradio server with the same functionality
python -m bleep_that_sht/gradio_app_url_download.py
This is the version hosted in the HF space .
Start this streamlit demo locally that lets you drag and drop local video files to bleep
python -m streamlit run bleep_that_sht/app_video_upload.py