/manga-translator

A manga translator built with python

Primary LanguagePython

Manga Translator

Why ?

  • Boy read manga.
  • Boy reach latest chapter.
  • Chapter not translated.
  • Boy get mad.
  • Boy do code instead of waiting like a normal person.

How ?

  • Yolo for bubble recognition and text segmentation
  • Open CV for bubble and masking
  • PIL for text replacement
  • Api's or neural networks for translation
  • Deepfillv2 for inpainting and bubble cleanup

Progress

  • Bubble inpainting using deepfillv2 credit to nipponjo and his implementation
  • Bubble recognition (should improve with more training data)
  • Free text recognition (should improve with more training data)
  • Bubble text extraction
  • Bubble masking
  • Bubble text insertion
  • Bubble Text ocr
  • Bubble Text translation
  • Bubble Text hypenation
  • Format and structure dataset
  • Create converters i.e. yolo => coco, my dataset => yolo etc
  • Better free text ocr
  • Better free text translation
  • Add more inpainting options i.e sd
  • Improve text resize algorithm, some texts are too small/big
  • Implement "https://github.com/advimman/lama" for cleaning

Models

  • Available in the latest release

Install

  • setup Anaconda
  • clone this repository
  • Open a terimal in the cloned repository
  • Run the following in the terminal to create an enviroment
conda create -n manga-translator python=3.9.12
conda activate manga-translator
  • Install Poetry
  • Run the following in the enviroment we created
poetry install
poe install-deps
# For cuda support run "poe force-cuda"
  • Download models to models/modelname (i.e. models/detection.py)
  • If you plan to use the UI also install NodeJS

Run

UI

poe run-server

CLI

python main.py -m [live|convert -f "files"]

Datasets

Detection

Segmentation

assets/examples

Original Translated
Original Result
Japanese => English
Jujutsu Kaisen
Original Result
Japanese => "Meow"
Solo Leveling
Original Result
Japanese => Clean
The Rising of the Shield Hero
Original Result
Japanese => English
A Certain Scientific Accelerator
Original Result
Japanese => English
One Punch Man
Original Result
Japanese => English
Oshi No Ko

Glossary

  • Bubble: a speech bubble
  • Free text: text found on pages but not in speech bubbles
  • Bubble Text: text within speech bubbles