Instructions to use mayocream/manga-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mayocream/manga-ocr with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="mayocream/manga-ocr")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("mayocream/manga-ocr") model = AutoModelForMultimodalLM.from_pretrained("mayocream/manga-ocr", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Manga OCR
A SafeTensors-packaged Japanese manga OCR model based on kha-white/manga-ocr-base. It uses the Transformers Vision Encoder Decoder architecture with a ViT image encoder and a character-level Japanese BERT decoder.
Capabilities
The model is designed for printed Japanese text, particularly manga-specific layouts:
- vertical and horizontal text
- furigana
- text overlaid on illustrations
- varied fonts and styles
- degraded or low-resolution text crops
Loading
from transformers import AutoImageProcessor, AutoTokenizer, VisionEncoderDecoderModel
repo = "mayocream/manga-ocr"
model = VisionEncoderDecoderModel.from_pretrained(repo)
processor = AutoImageProcessor.from_pretrained(repo)
tokenizer = AutoTokenizer.from_pretrained(repo)
Input images should be cropped to the text region before recognition. See the original manga_ocr project for its complete normalization and decoding pipeline.
Model details
- Task: Japanese image-to-text OCR
- Encoder: ViT/DeiT-style image encoder
- Decoder: character-level Japanese BERT with cross-attention
- Training dataset metadata: Manga109-s
- Format: Transformers-compatible SafeTensors
Limitations
This model does not detect text regions. Results depend on crop quality and can be unreliable for handwriting, unsupported characters, non-Japanese text, extreme perspective, or heavily obscured glyphs. OCR output should be reviewed before use in archival, legal, or accessibility-critical workflows.
License
Apache-2.0, matching the upstream model repository.
- Downloads last month
- 2,342
Model tree for mayocream/manga-ocr
Base model
kha-white/manga-ocr-base