Skip to main content

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

Metadata

Release files for pgsocr 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgsocr 0.1.5
File Size Uploaded
pgsocr-0.1.5.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgsocr 0.1.5
File Interpreter ABI Platform
pgsocr-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / pgsocr-0.1.5.tar.gz

Download URL pgsocr-0.1.5.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4827ce87b525728bc76d411d2e295c2417a2a5fc7dd7dbfda4f0acd122ddd1b5
BLAKE2b-256 checksum
How to use checksums
77982d5bb87a2a751bfc3a966a650e520b0408b487036e97597dc07cb124ebdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.18.1 CPython/3.12.5 Linux/6.10.6-arch1-1

Release files / pgsocr-0.1.5-py3-none-any.whl

Download URL pgsocr-0.1.5-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4222d34aa3e491f85b5f0b73cd30c405b4257db7f47c64195f36aae9d0a4b25
BLAKE2b-256 checksum
How to use checksums
0f04985fcdcea8ee42f3df227621e1cc097515cbb253d9652c8efc6dde688d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.18.1 CPython/3.12.5 Linux/6.10.6-arch1-1

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page