/bleepy

Bleepy is a Python program that can block Tagalog and English profanity in audio and videos.

Primary LanguagePythonMIT LicenseMIT

bleepy mascott

bleepy

Bleepy is a Python program that can block Tagalog and English profanity in audio and videos.

Docker Setup

  1. git clone ... this repo
  2. cd ... into this repo
  3. mkdir -p data/input
  4. cp <path-to-your-video-file> data/input/video.mov
  5. cp <path-to-your-bleep-audio-file-that-will-overwrite-the-audio-of-detected-profanity> data/input/bleep.mp3
  6. docker compose up
  7. docker compose down when it completes

Manual Setup

Requirements

The following are the Python modules and software that are needed to run this program.

FFMPEG

Note: FFMPEG is also needed to be installed to run this program.

Python modules

  1. vosk-api

  2. bleepy-profanity-check

Development

Installation

  1. Clone this repository.

  2. Install Python 3.

    • Download here
    • Python version 3.9 or above
    • Create a virtual environment by running python -m venv venv
    • Activate the virtual environment by running .\venv\Scripts\Activate.ps1
    • Check if you have the right python version: python --version should output 3.9.0 or higher
  3. Install FFMPEG.

    • Easy Installation tutorial for FFMPEG
    • If you install VLC Media Player, you already have FFMPEG
  4. Install Packages. You can easily install packages by running python -m pip install -r requirements.txt

  5. Set up the language model (follow the instructions).

    • Download the language model for vosk from models page. My suggested model is vosk-model-en-us-aspire-0.2.
    • Paste it inside bleepy directory or folder. Make sure the file is inside the bleepy folder.
    • Extract it.
    • Rename it to model.
  6. Try to run test_bleepy.py.

Testing and linting

  1. pip install pylint
  2. pip install pytest
  3. pylint bleepy

Trouble in FFMPEG

set PATH=%PATH%;<somepathhere>\ffmpeg\bin E.g. set PATH=%PATH%;C:\Users\Username\ffmpeg\bin