Skip to main content

A command line utility for converting Blu-ray subs to SRT or ASS using AI Language Models.

Reason this release was yanked:

Bug with MiniCPM model

Project description

pgsocr

Convert Blu-Ray SUP subtitles to SRT or ASS using AI Language Models or Tesseract.

Prerequisites

If planning on using Tesseract, see: https://tesseract-ocr.github.io/tessdoc/Installation.html
Make sure to install all the required language packs and note down the location of the 'tessdata' directory.
Make sure to set the TESSDATA_PREFIX environment variable to the location of the 'tessdata' directory from the previous step.

Installation

Download the latest .whl from the Releases tab and install using pip.
Make sure to install the [lm] extras if you want to use AI models.

Usage:

Options:
-i: Specify the path to the SUP file or (batch mode) directory.
-o: Specify the path to the output directory.
-m: Specify the OCR engine to use (florence2 or tesseract or minicpmv).
-l: (Only if using Tesseract) Specify the list of languages to use separated by spaces. Defaults to English.
-b: (Only if using Tesseract) Specify a custom character blacklist for Tesseract. Enter an empty string to turn off the default blacklist.
-f: Specify the output format (SRT or ASS). ASS output also has support for subtitle positioning.

Note: The AI models are more accurate than Tesseract but far more resource heavy. A recent GPU with a large amount of VRAM is recommended.

Examples:
# Single file
pgsocr -i /path/to/file -o path/to/outputdir -m tesseract -l eng jpn

# Multiple files in a directory
pgsocr -i /path/to/inputdir -o /path/to/outputdir -m florence2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgsocr-0.1.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

pgsocr-0.1.4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file pgsocr-0.1.4.tar.gz.

File metadata

  • Download URL: pgsocr-0.1.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.5 Linux/6.10.6-arch1-1

File hashes

Hashes for pgsocr-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ba46c5ec57da99b4da15c62d12f80c42befd842c42d0eb11242feb968fb470da
MD5 29fcf024b80a2cf85dcee51f7b8b86cb
BLAKE2b-256 16871dbb76bb10cb09e2d64ed0c11db9266ab72a6a3827f13bf00b4928cbec13

See more details on using hashes here.

File details

Details for the file pgsocr-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: pgsocr-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.12.5 Linux/6.10.6-arch1-1

File hashes

Hashes for pgsocr-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1de27b031a72815440eb57cf8520f8910f87f7f3bd75866c6ed3d979145cf089
MD5 52be9eabff0faf01f5b878bbb9615e90
BLAKE2b-256 8e864b8ec20ef1719af84430a3c22868a8a43422976b8861b36280dc48ab7a04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page