Giter Site home page Giter Site logo

sebion06 / media-player-with-gen-subtitles-for-intel-npu Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.54 MB

A python vlc player that transcribes subtitles on the Intel NPU

License: MIT License

Python 100.00%
npu inference python3 trans transc vlc-media-player whisper-ai

media-player-with-gen-subtitles-for-intel-npu's Introduction

Intel NPU - vlc player with generated subtitles by OpenAI-Whisper

A python vlc player that transcribes subtitles while watching a video. The model used to automatically generate the subtitles is Whisper, by Open-AI. The default model version is the tiny one, for low memory impact, which doesn't have a translation capability, so the subtitle translations are done using the google-trans package.

The Whisper model is compiled using the Intel® NPU Acceleration Library, so that it ultimately runs on the Intel NPU, releaving the CPU or GPU of the processing for a low-powered and efficient inference.

Content

./src : source files of the application

./media : various media files used by the project, including a test video file

Prerequisites

For the application to run properly, install the following prerequisites:

  • the VLC media player, as the python package is just an API
  • the FFmpeg suite for proper handling of video and audio files.

Installation

The video player runs on the python3 programming language. Testing was done on version 3.10.11.

Package requirements:

googletrans==3.0.0
PyQt6==6.6.1
torch==1.11.0
intel_npu_acceleration_library==1.0.0
openai-whisper==20231117
python-vlc==3.0.20123

Install:

pip install -r /src/requirements.txt

Usage

The app GUI can be started by running the main.py file:

python src/main.py

Optional Arguments

options:
  --model {tiny,base,small,medium,large}
                        Whisper-AI model version
  --in_lan {af,sq,am,ar,hy,az,eu,be,bn,bs,bg,ca,ceb,ny,zh-cn,zh-tw,co,hr,cs,da,nl,en...} , default=en
                        Input lanuage of media file
  --out_lan {af,sq,am,ar,hy,az,eu,be,bn,bs,bg,ca,ceb,ny,zh-cn,zh-tw,co,hr,cs,da,nl,en...}, default=en
                        Output language for subtitles
  --gen_sub_file True/False, default=False
                        Generates a subtitle file

For the model version, keep in mind the various resources needed for running: Source: openai-whisper pip package

Size Parameters model Required VRAM Relative speed
tiny 39 M tiny ~1 GB ~32x
base 74 M base ~1 GB ~16x
small 244 M small ~2 GB ~6x
medium 769 M medium ~5 GB ~2x
large 1550 M large ~10 GB 1x

Usage example

alt text

media-player-with-gen-subtitles-for-intel-npu's People

Contributors

sebion06 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.