Skip to content

andrewwkimm/koffee

Repository files navigation

koffee logo

koffee CI codecov Code style: black pre-commit

koffee is a tool that automates the translation and subtitling of Korean<>English videos.

Dependencies

Python versions >=3.10 are supported. Additionally, ffmpeg is required for koffee to run.

Installation

koffee can be installed using pip.

pip install git+https://github.com/andrewwkimm/koffee

Quick start

All that is needed is a working video file and the translated video will be outputted to the current directory.

koffee some_dir/some_video_file.mp4

Alternatively, usage through Python is also available.

import koffee


koffee.translate("some_dir/some_video_file.mp4")

Here is an example output using a sample video from examples.

sample_korean_video_translated.mp4

Usage

The koffee CLI has the following structure:

koffee COMMAND [ARGS] [OPTIONS]

Refer below for a list of all commands and parameters.

Parameters

--file_path                Path to the video file.
--device, -d               Device to use for computation.
--compute_type, -c         Type to use for computation.
--model, -m                The Whisper model instance to use.
--output_dir, -o           Directory for the output file.
--output_name, -n          Name of the output file.
--subtitle_format, -sf     Format to use for the subtitles.
--target_language, -t      Language to which the video should be translated.

Options

--help, -h                 Display this message and exit.
--version, -v              Display application version.
--verbose, -V              Print debug logs.
--subtitles, -s            Write the translated subtitle file to disk.

Contributing

The simplest way to start developing is by using either a DevContainer or Poetry.

If you are planning to develop inside DevContainer, choose the CUDA setup if you have a NVIDIA graphics card and would like to run koffee with CUDA support; otherwise, the default build is much leaner and recommended.

For Poetry, run the following commands to set up your environment:

git clone https://github.com/andrewwkimm/koffee.git
cd koffee
pip install pre-commit
make setup

Credits

Special thanks to Leah Song for designing the koffee logo.

Credits to 여배우의 책방 for the full version of the sample Korean video.

About

Automated Korean<>English video file translation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published