GithubHelp home page GithubHelp logo

Comments (10)

zyddnys avatar zyddnys commented on August 24, 2024

please provide a failure example and your arguments

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

Hi,

This is the command I'm using:

python -m manga_translator -l ENG --translator=offline --font-size-minimum=15 --font-path _fontpath_/KOMIKASL.ttf --mask-dilation-offset=5 -f jpg --detector=ctd --inpainter=lama_mpe -i "_inputFolder_" --manga2eng

fontpath and inputFolder are real paths, of course. Below are the input and output images. You can see the text on the lower left panel is badly translated, with the OCR failing to recognise the text as being horizontal.

00148
00148

Hopefully this helps.

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

From what I can see in the several cases I came across, it seems the OCR recognizes horizontal, multi-line phrases as if each line was a column of vertical text orientation - including trying to interpret the kanji rotated, which is why the translation is complete rubbish.

I say this because the same doesn't happen if there's just a single line. If it is just a single, horizontal line, the OCR properly detects it as being on the horizontal orientation and detects correctly the characters.

I understand that there's a need to cater for vertical aligned text (being the majority of it, of course), but maybe the OCR code can be improved so that, if the text rotation is more than 45 degrees (with zero degrees being the text being perfectly vertical), it is to be detected as horizontal.

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

Maybe this can help. I've ran it on demo mode, obtaining the intermediates. You can see that the bbox in question (5) is wrongly detected as being rotated 74.26 degrees (since it was detected as a vertical aligned text heavily rotated), but another bbox with the same orientation (3) is correctly detected as being rotated only -9.93 degrees (i.e. properly detected as horizontal text, with a small rotation).
bboxes

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

@dmMaze I think this may be more on your area? I think the code for the Comic Text Detector is yours, isn't it?

Checking the code, the issue doesn't seem to be on the OCR step, but on the textbox detection. The text box is not on the right orientation, so it passes the detected text on the vertical to the OCR.

from manga-image-translator.

dmMaze avatar dmMaze commented on August 24, 2024

@itsdapolice
It's some text-detection postprocessing or ocr preprocessing I didn't write. Ballonstranslator can do it right:
图片

I'll take my time to investigate why it's wrong in manga-image-translator

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

@itsdapolice It's some text-detection postprocessing or ocr preprocessing I didn't write. Ballonstranslator can do it right: 图片

I'll take my time to investigate why it's wrong in manga-image-translator

Thanks, mate. I did try to wrap my head around the code, but I'm way too unfamiliar with it to be of any help.

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

I've tested the new commit and works like a charm. Thanks, @dmMaze .

from manga-image-translator.

dmMaze avatar dmMaze commented on August 24, 2024

@itsdapolice Just a reminder 8925d36 would fail some vertical cases. Please update to 391d799

from manga-image-translator.

itsdapolice avatar itsdapolice commented on August 24, 2024

@itsdapolice Just a reminder 8925d36 would fail some vertical cases. Please update to 391d799

Thanks, will do.

from manga-image-translator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.