manga ocr base

Providerkha-white
Categoryimage-to-text
Licenseapache-2.0
Downloads520.4K
Stars0

Overview

Manga OCR Base is a specialized image-to-text model engineered specifically for the complexities of Japanese manga typesetting. Unlike general-purpose OCR, this model is optimized to handle vertical text flow, stylized fonts, and the overlapping visual noise common in comic panels. For developers, it serves as a robust backend for translation pipelines, archival tools, or accessibility plugins. It integrates easily into Python-based workflows via standard OCR wrappers, offering a focused alternative to monolithic vision models by prioritizing high accuracy in niche typographic layouts over general scene recognition.

Highlights

  • Optimized for vertical Japanese text and stylized fonts
  • Ideal for automated manga translation and archival pipelines
  • Apache-2.0 license ensures flexible commercial integration
  • High precision in high-noise comic panel environments

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("kha-white/manga-ocr-base")
tokenizer = AutoTokenizer.from_pretrained("kha-white/manga-ocr-base")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download kha-white/manga-ocr-base

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download kha-white/manga-ocr-base config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('kha-white/manga-ocr-base')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/kha-white/manga-ocr-base

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/kha-white/manga-ocr-base

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('kha-white/manga-ocr-base')
tokenizer = AutoTokenizer.from_pretrained('kha-white/manga-ocr-base')

Full Documentation

来源: HuggingFace

---
language: ja
tags:

  • image-to-text

license: apache-2.0
datasets:
  • manga109s

---

Manga OCR

Optical character recognition for Japanese text, with the main focus being Japanese manga.

It uses Vision Encoder Decoder framework.

Manga OCR can be used as a general purpose printed Japanese OCR, but its main goal was to provide a high quality
text recognition, robust against various scenarios specific to manga:

  • both vertical and horizontal text

  • text with furigana

  • text overlaid on images

  • wide variety of fonts and font styles

  • low quality images

Code is available here.

Join our Telegram