Giter VIP home page Giter VIP logo

mokuro's People

Contributors

cfkaligula avatar dylan-brackett avatar elnudev avatar imsamuka avatar justremember avatar kha-white avatar liwll avatar neggedah avatar zxy101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mokuro's Issues

package versions have conflicting dependencies

This appeared both before and after installing Python 3.9. It occasionally shows up and occasionally doesn't.

C:\Users\OWNER>pip3 install mokuro
Collecting mokuro
Using cached mokuro-0.1.6-py3-none-any.whl (116 kB)
Collecting loguru
Using cached loguru-0.6.0-py3-none-any.whl (58 kB)
Collecting torchsummary
Using cached torchsummary-1.5.1-py3-none-any.whl (2.8 kB)
Collecting opencv-python>=4.1.2
Using cached opencv_python-4.7.0.68-cp37-abi3-win32.whl (28.2 MB)
Collecting mokuro
Using cached mokuro-0.1.5-py3-none-any.whl (116 kB)
Using cached mokuro-0.1.4-py3-none-any.whl (116 kB)
Using cached mokuro-0.1.3-py3-none-any.whl (114 kB)
Using cached mokuro-0.1.2-py3-none-any.whl (114 kB)
Using cached mokuro-0.1.1-py3-none-any.whl (114 kB)
Using cached mokuro-0.1.0-py3-none-any.whl (114 kB)
ERROR: Cannot install mokuro==0.1.0, mokuro==0.1.1, mokuro==0.1.2, mokuro==0.1.3, mokuro==0.1.4, mokuro==0.1.5 and mokuro==0.1.6 because these package versions have conflicting dependencies.

The conflict is caused by:
mokuro 0.1.6 depends on torchvision>=0.8.1
mokuro 0.1.5 depends on torchvision>=0.8.1
mokuro 0.1.4 depends on torchvision>=0.8.1
mokuro 0.1.3 depends on torchvision>=0.8.1
mokuro 0.1.2 depends on torchvision>=0.8.1
mokuro 0.1.1 depends on torchvision>=0.8.1
mokuro 0.1.0 depends on torchvision>=0.8.1

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Will this work with DirectML?

I don't really know much about it, but I could invest the time if you say I can.
I have an AMD GPU and I use Windows.

Use ⋮ instead of ... when vertical

. 


versus

Is more like a suggestion than an issue, but would be cleaner to make the code replace 3 dots in vertical with the Vertical Ellipsis “⋮” character or to read them together already. Using the dots separated ocupe too much space and makes the column all messy.

Can look dumb, but an separated suggestion is to describe what kinda of files the Mokuro is compatible with in the read me, took me some time to realize it was jpg instead of pdf. Maybe in the future integrate an auto turn pdf into jpg feature into Mokuro! Anyways thanks, awesome job!
imagen_2022-12-27_154308699
imagen_2022-12-27_154327360

Yomichan unable to use pop ups

Using Yomichan im able to get pop ups on the html, its working every else but this. Not entirely sure why its not working on the html file.
But also would be cool if you also shared the text format you're using for the OCR for that pop up.

Edit: I was stupid and never enabled URL in the yomichan settings

Manga missing - Blank pages

Not sure what is happening now, but it was working before and now everything is just broken. The pages do not come up only the words but its more of trying to find them. Not sure what happened or why
image

Made Simple to Follow Guide

Hey there, thanks for your work. This is very useful. Though the installation instructions (both the readme and the guide provided) were a little difficult to follow for those unfamiliar with github, python and this type of installation. I made a simple guide that I tried to make as simple as possible for people who would like to use this but have had some trouble.

Please let me know if there is anything I misunderstood, got wrong or if something else can be better simplified. Feel free to use this guide as you wish.

Guide

keep zoom level, but start next page at the top

Hi, I love the project, but I can't find a decent reading flow from one page to the next.

If I maintain zoom, pressing Page Down will show the end of the next page, not the beginning.
Is there a way for the beginning of the next page to show up in that case?

Alternatively, being able to scroll down infinitely maintaining zoom would be even better.

ImportError: DLL load failed while importing fugashi: The specified module could not be found.

C:\Users\Seven7>mokuro "C:\A\Summertime renderer v01"

Paths to process:

C:\A\Summertime renderer v01

Each of the paths above will be treated as one volume. Continue? [yes/no]
yes
2022-05-05 13:18:13.152 | INFO     | mokuro.run:run:40 - Processing 1/1: C:\A\Summertime renderer v01
Processing pages...:   0%|                                                                                                                                                                                          | 0/294 [00:00<?, ?it/s]2022-05-05 13:18:13.170 | INFO     | mokuro.manga_page_ocr:__init__:30 - Initializing text detector
2022-05-05 13:18:13.614 | INFO     | manga_ocr.ocr:__init__:13 - Loading OCR model from kha-white/manga-ocr-base
Processing pages...:   0%|                                                                                                                                                                                          | 0/294 [00:06<?, ?it/s]
2022-05-05 13:18:19.524 | ERROR    | mokuro.run:run:44 - Error while processing C:\A\Summertime renderer v01
Traceback (most recent call last):

  File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
           │         │     └ {'__name__': '__main__', '__doc__': None, '__package__': '', '__loader__': <zipimporter object "C:\Users\Seven7\AppData\...
           │         └ <code object <module> at 0x000002AF10CFFF50, file "C:\Users\Seven7\AppData\Roaming\Python\Python39\Scripts\mokuro.exe\__...
           └ <function _run_code at 0x000002AF104DECA0>

  File "c:\program files\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
         │     └ {'__name__': '__main__', '__doc__': None, '__package__': '', '__loader__': <zipimporter object "C:\Users\Seven7\AppData\...
         └ <code object <module> at 0x000002AF10CFFF50, file "C:\Users\Seven7\AppData\Roaming\Python\Python39\Scripts\mokuro.exe\__...

  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\Scripts\mokuro.exe\__main__.py", line 7, in <module>
    sys.exit(main())
    │   │    └ <function main at 0x000002AF10CEC280>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>

  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\mokuro\__main__.py", line 7, in main
    fire.Fire(run)
    │    │    └ <function run at 0x000002AF36438CA0>
    │    └ <function Fire at 0x000002AF36438F70>
    └ <module 'fire' from 'C:\\Users\\Seven7\\AppData\\Roaming\\Python\\Python39\\site-packages\\fire\\__init__.py'>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\fire\core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
                      │     │          │     │                 │        └ 'mokuro'
                      │     │          │     │                 └ {}
                      │     │          │     └ Namespace(verbose=False, interactive=False, separator='-', completion=None, help=False, trace=False)
                      │     │          └ ['C:\\A\\Summertime renderer v01']
                      │     └ <function run at 0x000002AF36438CA0>
                      └ <function _Fire at 0x000002AF364C0F70>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\fire\core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
    │                           └ <function _CallAndUpdateTrace at 0x000002AF364C20D0>
    └ <function run at 0x000002AF36438CA0>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
                │   │          └ {}
                │   └ ['C:\\A\\Summertime renderer v01']
                └ <function run at 0x000002AF36438CA0>
> File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\mokuro\run.py", line 42, in run
    ovg.process_dir(path, as_one_file=as_one_file)
    │   │           │                 └ True
    │   │           └ WindowsPath('C:/A/Summertime renderer v01')
    │   └ <function OverlayGenerator.process_dir at 0x000002AF36438790>
    └ <mokuro.overlay_generator.OverlayGenerator object at 0x000002AF364AE490>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\mokuro\overlay_generator.py", line 82, in process_dir
    self.init_models()
    │    └ <function OverlayGenerator.init_models at 0x000002AF36438700>
    └ <mokuro.overlay_generator.OverlayGenerator object at 0x000002AF364AE490>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\mokuro\overlay_generator.py", line 55, in init_models
    self.mpocr = MangaPageOcr(self.pretrained_model_name_or_path, self.force_cpu, **self.kwargs)
    │    │       │            │    │                              │    │            │    └ {}
    │    │       │            │    │                              │    │            └ <mokuro.overlay_generator.OverlayGenerator object at 0x000002AF364AE490>
    │    │       │            │    │                              │    └ False
    │    │       │            │    │                              └ <mokuro.overlay_generator.OverlayGenerator object at 0x000002AF364AE490>
    │    │       │            │    └ 'kha-white/manga-ocr-base'
    │    │       │            └ <mokuro.overlay_generator.OverlayGenerator object at 0x000002AF364AE490>
    │    │       └ <class 'mokuro.manga_page_ocr.MangaPageOcr'>
    │    └ None
    └ <mokuro.overlay_generator.OverlayGenerator object at 0x000002AF364AE490>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\mokuro\manga_page_ocr.py", line 34, in __init__
    self.mocr = MangaOcr(pretrained_model_name_or_path, force_cpu)
    │           │        │                              └ False
    │           │        └ 'kha-white/manga-ocr-base'
    │           └ <class 'manga_ocr.ocr.MangaOcr'>
    └ <mokuro.manga_page_ocr.MangaPageOcr object at 0x000002AF36512BE0>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\manga_ocr\ocr.py", line 15, in __init__
    self.tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path)
    │                │             │               └ 'kha-white/manga-ocr-base'
    │                │             └ <classmethod object at 0x000002AF36322BB0>
    │                └ <class 'transformers.models.auto.tokenization_auto.AutoTokenizer'>
    └ <manga_ocr.ocr.MangaOcr object at 0x000002AF36512BB0>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\transformers\models\auto\tokenization_auto.py", line 528, in from_pretrained
    return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
           │               │               │                               │         └ {'_from_auto': True}
           │               │               │                               └ ()
           │               │               └ 'kha-white/manga-ocr-base'
           │               └ <classmethod object at 0x000002AF362883D0>
           └ <class 'transformers.models.bert_japanese.tokenization_bert_japanese.BertJapaneseTokenizer'>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\transformers\tokenization_utils_base.py", line 1780, in from_pretrained
    return cls._from_pretrained(
           │   └ <classmethod object at 0x000002AF36288490>
           └ <class 'transformers.models.bert_japanese.tokenization_bert_japanese.BertJapaneseTokenizer'>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\transformers\tokenization_utils_base.py", line 1915, in _from_pretrained
    tokenizer = cls(*init_inputs, **init_kwargs)
                │    │              └ {'unk_token': '[UNK]', 'sep_token': '[SEP]', 'pad_token': '[PAD]', 'cls_token': '[CLS]', 'mask_token': '[MASK]', 'do_lower_ca...
                │    └ ()
                └ <class 'transformers.models.bert_japanese.tokenization_bert_japanese.BertJapaneseTokenizer'>
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\transformers\models\bert_japanese\tokenization_bert_japanese.py", line 151, in __init__
    self.word_tokenizer = MecabTokenizer(
    │                     └ <class 'transformers.models.bert_japanese.tokenization_bert_japanese.MecabTokenizer'>
    └ PreTrainedTokenizer(name_or_path='kha-white/manga-ocr-base', vocab_size=6144, model_max_len=1000000000000000019884624838656, ...
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\transformers\models\bert_japanese\tokenization_bert_japanese.py", line 231, in __init__
    import fugashi
  File "C:\Users\Seven7\AppData\Roaming\Python\Python39\site-packages\fugashi\__init__.py", line 1, in <module>
    from .fugashi import *

ImportError: DLL load failed while importing fugashi: The specified module could not be found.
2022-05-05 13:18:19.552 | INFO     | mokuro.run:run:48 - Processed successfully: 0/1

Processed successfully: 0/1

AssertionError: /Users/_/Downloads/Manga/ジョジョリオン 27.cbz must be a directory
| INFO | mokuro.run:run:48 - Processed successfully: 0/1
Device: M1 Macbook Pro Monterey 12.1

No HTML file is made if a file is directly path to

Grey page visualised if opened in Kiwi Browser

It would be great if Mokuro worked in Kiwi Browser, as this is the only way to use Yomichan on Android.

Mokuro working in Kiwi Browser means reading manga on an Android tablet with Yomichan.

I couldn't make it work in Kiwi Browser installed on my Motorola phone, neither on my Lenovo tablet. It looks like it's a Kiwi Browser issue.

RuntimeError

I am getting this error both on google colab and on PC.

RuntimeError: Failed to import transformers.models.bert_japanese.tokenization_bert_japanese because of the following error (look up to see its traceback):
No module named 'sentencepiece'

Mokuro html only lets me hover panels for a japanese to english 'word' translation

Mine looks different to the video

Instead of like the demo video on github giving the full translation and meaning with the japanese I only get an exact english word translation when i hover the mouse over the japanese text. And I had to turn google translate on for this.

Also, when I go 'right click', 'inspect', 'console' i get three translation errors for coding

This is what the error says

Failed to load resource: net::ERR_FILE_NOT_FOUND
file://translate.google.com/gen204?sl=auto&tl=en&textlen=119&ttt=540&ttl=256&ttf=598&sr=1&nca=te_time&client=te_lib&logld=vTE_20221207

Did anyone get something similar?

Apparently yomichan is also good but I really ceebs learning to code another html text translator again https://rentry.co/lazyXel#mangaocr-or-manga-with-yomichan

It seems like this error is from mokuro's end

Where is pytorch_model.bin located?

I am stuck in this command:

Downloading (…)"pytorch_model.bin";: 47%|███▎ | 210M/444M [05:31<06:10, 633kB/s]

because of bad connection here.

I could maybe download it with wget or aria2 but where should I put it?

Can't move processed manga to other computers

I copied the ocr folder and the html file but when I tried to open it on another machine it didn't work. Is there a solution to make the process manga portable not including turning it into a pdf

numpy 1.24: AttributeError: module 'numpy' has no attribute 'int'

I think there was a breaking change in numpy 1.24.

  File "/usr/local/lib/python3.10/dist-packages/comic_text_detector/utils/db_utils.py", line 200, in box_score_fast
    xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1)
           │  │    │  │     │                       │           └ 1024
           │  │    │  │     │                       └ <module 'numpy' from '/usr/local/lib/python3.10/dist-packages/numpy/__init__.py'>
           │  │    │  │     └ array([[ 752,  999],
           │  │    │  │              [ 753,  999],
           │  │    │  │              [ 754, 1000],
           │  │    │  │              [ 755, 1000],
           │  │    │  │              [ 756, 1001],
           │  │    │  │              [ 755, 1000],...
           │  │    │  └ <ufunc 'floor'>
           │  │    └ <module 'numpy' from '/usr/local/lib/python3.10/dist-packages/numpy/__init__.py'>
           │  └ <function clip at 0x7fbe149ea8c0>
           └ <module 'numpy' from '/usr/local/lib/python3.10/dist-packages/numpy/__init__.py'>
  File "/usr/local/lib/python3.10/dist-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "

AttributeError: module 'numpy' has no attribute 'int'

Installing version 1.23.0 instead of 1.24.0 of numpy works instead.

CBZ/CBR file support

It seems like CBZ/CBR files aren't currently supported, if you pass one of these file formats into mokuro you get a gnarly error.

To get around it, I just unzip the files and then run it on the directory, which works great. It's not a huge hassle so I will keep doing that for now, but I would love to see this feature in the future!

[REQUEST] Character counter

Much like some people like to track the number of characters read when reading a VN (e.g. via a texthooker page with a character counter), it'd be cool to have something similar here in the top part of the UI that tracks the number of characters as you read.

AFAIK there's nothing like that out there for manga, so that'd be a unique feature that this tool would enable.

Mokuro html lags after a while of being open..

This is an issue I see more with manga with larger file sizes but it still happens on small files as well. The page just stops working when I try to hover over text, or even turn the page. I don't know why it happens, so I was wondering if there's anything I could do. Also, browser doesn't matter whether it be a fresh chrome account, one with extensions or even another browser like Vivaldi.

Add the ability to toggle OCR text on click/touch

Some mobile tools (namely 10ten on iOS) require you to move a secondary cursor on the screen to the words to use its pop up dictionary. However after clicking on the OCR text box to get the text to appear, trying to drag the pop up dictionary cursor closes the text box. It would be nice if there was a setting to toggle the text boxes on touch/mouse click so they will stay open until you click off so that you can use the pop up dictionaries correctly.

Mokuro generated files on android

How to use mokuro HTML on android?
I'm using kiwi browser and don't see any images. Maybe there is smarter way (convert to other format)?

Blank HTML File

Hello, I recently followed Xelieu's guide on using Mokuro. I finished creating the HTML and OCR files for 18 volumes of Karakai Takagi-san but none of the HTML works. Done through google collab.

Blurry images

844*1200 jpeg

It's especially noticeable on smaller text.

Both images are at 100% zoom. Left is feh, right is mokuro.

image

other example:
image

Original pane:
page0061

AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'register_load_context_function'

I get this error when trying to run it

Traceback (most recent call last):
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\Scripts\mokuro.exe\__main__.py", line 4, in <module>
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\mokuro\__init__.py", line 3, in <module>
    from mokuro.manga_page_ocr import MangaPageOcr
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\mokuro\manga_page_ocr.py", line 8, in <module>
    from manga_ocr import MangaOcr
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\manga_ocr\__init__.py", line 3, in <module>
    from manga_ocr.ocr import MangaOcr
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\manga_ocr\ocr.py", line 8, in <module>
    from transformers import AutoFeatureExtractor, AutoTokenizer, VisionEncoderDecoderModel
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\__init__.py", line 30, in <module>
    from . import dependency_versions_check
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\dependency_versions_check.py", line 17, in <module>
    from .utils.versions import require_version, require_version_core
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\utils\__init__.py", line 34, in <module>
    from .generic import (
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\utils\generic.py", line 33, in <module>
    import tensorflow as tf
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\__init__.py", line 469, in <module>
    _keras._load()
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 41, in _load
    module = importlib.import_module(self.__name__)
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\__init__.py", line 21, in <module>
    from keras import models
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\models\__init__.py", line 18, in <module>
    from keras.engine.functional import Functional
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\engine\functional.py", line 34, in <module>
    from keras.engine import training as training_lib
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\engine\training.py", line 45, in <module>
    from keras.saving.legacy import save
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\saving\legacy\save.py", line 24, in <module>
    from keras.saving.legacy.saved_model import load_context
  File "C:\Users\xelak\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\saving\legacy\saved_model\load_context.py", line 68, in <module>
    tf.__internal__.register_load_context_function(in_load_context)
AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'register_load_context_function'

Unable to load weights for pytorch checkpoint file

My main OS is NixOS, but I was having some issues getting the Python dependencies packaged, so I wanted to give mokuro a shot on Windows 10 first.

I have Python 3.9.13 installed (I checked and apparently PyTorch supports 3.10 now despite what the README says; I had the same issue in 3.10), and I have gone through the setup instructions. I have an Nvidia RTX 2060 SUPER, so I installed PyTorch with CUDA 11.7 per the instructions on PyTorch's website with pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117.

When I entered the directory with my scan image files and ran mokuro ., I got this error:

OSError: Unable to load weights from pytorch checkpoint file for 'C:\Users\elnu/.cache\huggingface\hub\models--kha-white--manga-ocr-base\snapshots\aa6573bd10b0d446cbf622e29c3e084914df9741\pytorch_model.bin' at 'C:\Users\elnu/.cache\huggingface\hub\models--kha-white--manga-ocr-base\snapshots\aa6573bd10b0d446cbf622e29c3e084914df9741\pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.
2023-04-18 13:13:24.868 | INFO     | mokuro.run:run:51 - Processed successfully: 0/1

Full output here.

Any ideas what's gone wrong? Have I missed something? Thanks in advance.

Update: Just wanted to add that I was reading through Xelieu's guide and they mentioned that there sometimes is a problem where torch.cuda.is_available() may return False. I checked and for me this was the case, and even after reinstalling torch and verifying that it started detecting CUDA as available, I still ran into the same issue.

onnx-simplifier onnxoptimizer dependency conflict

During pip install:

  Downloading mokuro-0.1.1-py3-none-any.whl (114 kB)
     ---------------------------------------- 114.3/114.3 KB 3.4 MB/s eta 0:00:00
  Downloading mokuro-0.1.0-py3-none-any.whl (114 kB)
     ---------------------------------------- 114.3/114.3 KB 3.4 MB/s eta 0:00:00
ERROR: Cannot install mokuro because these package versions have conflicting dependencies.

The conflict is caused by:
    onnx-simplifier 0.3.8 depends on onnxoptimizer>=0.2.6
    onnx-simplifier 0.3.7 depends on onnxoptimizer>=0.2.5
    onnx-simplifier 0.3.6 depends on onnxoptimizer>=0.2.5

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Not able to use google colab due to prompt

Unable to use the repo on my older desktop I decided to try the Colab. Unfortunately, this does not seem to work as when I use the command !mokuro 'this/path' the program prompt me with: continue? (yes/no). As only Google Colab pro users can have access to the terminal I cannot answer this prompt and the program is stuck.

Perhaps I am missing an easy fix here so please let me know if that is the case!

Converted manga won't work with yomichan

image

I converted this manga and tried to shift hover over multiple pages. Nothing came up but when I went to the other tab it worked with just random text on google.

Add Dark Mode

I think a dark mode would be a good addition since it would put less strain in the eyes, and it would be noticeable in longer reading sessions. Could be an option under settings that toggles dark/light mode.

it can be done with extensions right now but is not the ideal.

imagen

Issues converting certain types of speech bubbles

Thanks again for your hard work.

I've encountered this issue a few times across 3 or so volumes of One Piece. When one bubble is above another, the text will get slightly jumbled, and the outputted text will alternate between the first box and second rather than showing each line of text in sequential order.

Mokuro Issue before
Mokuro issue after

[REQUEST] Scanned light novels

There are so many light novels you can easily find scanned on certain websites, but you can't really find them as ebooks that easily without having to buy them. Would it be possible? I know this was created thinking about manga, but it'd be cool if it worked for light novels too.

010
I tried running mokuro on light novels too, but it doesn't seem catch text pages, only pages with ilustrations and some text within all pages. Also if someone mentioned it before I'll delete this request asap.

Bug: Mokuro html files breaking due to unicode weirdness

How to reproduce

  1. Create a folder in google drive manga/. upload this Test folder.
    Test.zip
  2. Directory structure should look like this: manga > Test > [あずまきよひこ] よつばと! 第01巻 > some images.
  3. Run https://colab.research.google.com/github/kha-white/mokuro/blob/master/notebooks/mokuro_demo.ipynb, changing the last line of code to !mokuro --parent_dir "/content/drive/MyDrive/manga/Test"
  4. Download the entire Test folder.
  5. Open the mokuro generated html. Verify the manga images not loading.
    image

Something weird is going on with Unicode parsing, particularly with the ず and ば characters. Both characters get transformed into another identical-looking but different character in the HTML file.

Can't get mokuro to work with GPU.

Hi, i used the following command to install the requirements but mokuro still uses CPU only: pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

Python location (version 3.9.12):
\AppData\Local\Programs\Python\Python39\python.exe
\AppData\Local\Microsoft\WindowsApps\python.exe

Mokuro location:
\AppData\Local\Programs\Python\Python39\Scripts\mokuro.exe

OS: Windows 10

Fails if file extensions are uppercase (.JPG or .PNG)

If the file extensions are uppercase (I've witnessed this a few times from downloaded manga) then the program will fail to find any of them.

I can see there was a pull request (#11) for this, but it haven't been pushed to pip because it still fails with uppercase extensions.

Installation with

pip3 install mokuro

Yomichan doesn't work with Mokuro for me?

I downloaded Yomichan on chrome but I cant get it to show up with mokuro using html.

The mouse and shift keys to get yomichan to pop up does not work but it works on a web url

So I think there's something wrong with my mokuro or how I set it up. But I downloaded Mokuro the basic way with python and pip and linked it to the path 100%. Didn't use pytorch or anaconda those exctra steps so im surprised its not working

If anyone had a similar issue and knows how to fix it, it'd be greatly appreciated :))

Failed to install package via pip

Hiya, I'm trying to run the project on python 3.9.13 and am getting the following error:

error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/rz/d266t0dn1md992kgv7z8tp480000gn/T/pip-install-mxoysvv8/fugashi_621defc0e8774e36a8d22bd2f46c3d4a/setup.py", line 15, in <module>
          output, data_files = check_libmecab()
        File "/private/var/folders/rz/d266t0dn1md992kgv7z8tp480000gn/T/pip-install-mxoysvv8/fugashi_621defc0e8774e36a8d22bd2f46c3d4a/fugashi_util.py", line 58, in check_libmecab
          raise RuntimeError("Could not configure working env. Have you installed MeCab?")
      RuntimeError: Could not configure working env. Have you installed MeCab?
      [end of output]

Sorts manga pages wrong way.

Have my manga sorted like this
image
all pages in order, no issues, yet chapter 2 is page 340 or 380 and chapter 3 is page 333(?)

i have 480 pages overall, chapter 10 happens right after chapter 1 yet it doesnt in my folder.

Half/whole manga pages missing

I am not sure what exactly happened, this was working before but now im only seeing one page or none at all.
Screenshot_20230520_223337_Kiwi Browser
I had my tablet set up and working, it was reading everything correctly not sure if something messed up with kiwi browser but before it was working flawlessly but now im only seeing some pages, some are cut up and some are just completely missing.

AttributeError: 'NoneType' object has no attribute 'shape'

Getting an error while running mokuro. This is being thrown from line 38 in manga_page_ocr.py

AttributeError: 'NoneType' object has no attribute 'shape'
2022-11-23 22:34:43.023 | INFO | mokuro.run:run:51 - Processed successfully: 0/1

PyTorch Intalled but i cant use gpu

>>> import torch
>>> x = torch.rand(5, 3)
>>> print(x)
tensor([[0.1846, 0.9418, 0.0773],
        [0.6418, 0.2262, 0.2997],
        [0.9134, 0.2455, 0.6753],
        [0.0256, 0.5766, 0.5302],
        [0.8522, 0.2849, 0.8297]])
>>> torch.cuda.is_available()
True
C:\WINDOWS\system32>mokuro "C:\A\ummertime renderer v01"

Paths to process:

C:\A\ummertime renderer v01

Each of the paths above will be treated as one volume. Continue? [yes/no]
y
2022-05-05 16:07:48.040 | INFO     | mokuro.run:run:40 - Processing 1/1: C:\A\ummertime renderer v01
Processing pages...:   0%|                                                                     | 0/215 [00:00<?, ?it/s]2022-05-05 16:07:48.058 | INFO     | mokuro.manga_page_ocr:__init__:30 - Initializing text detector
2022-05-05 16:07:48.499 | INFO     | manga_ocr.ocr:__init__:13 - Loading OCR model from kha-white/manga-ocr-base
2022-05-05 16:07:58.152 | INFO     | manga_ocr.ocr:__init__:22 - Using CPU
2022-05-05 16:07:58.822 | INFO     | manga_ocr.ocr:__init__:29 - OCR ready
Processing pages...:   1%|▌                                                            | 2/215 [00:18<29:45,  8.38s/it]

Manga pages out of order without leading zeroes

Went to process a manga that had volumes with and without leading zeroes on the page, the ones without got completely out of order (going 1 10-19 100 and so on instead)

Using a program to batch rename them fixed the issue, but I figured would be worth reporting if it's a fixable problem in the program itself

Changing page with arrow keys.

Hey there, love the application. I will be using it daily from now on.
One thing I noticed while using it today was that using the arrow keys moves the orientation of the page and doesn't change to a new page as I would expect.
Would this kind of functionality be welcomed?

Avif format support

Are there any plans to support avif image files in mokuro ? By looking at the code it seems that only jpg, jpeg and png are supported at the moment.

Could not find "cmake" executable!

C:\Users\OWNER>pip3 install mokuro
Collecting mokuro
Using cached mokuro-0.1.6-py3-none-any.whl (116 kB)
Collecting loguru
Using cached loguru-0.6.0-py3-none-any.whl (58 kB)
Collecting pyclipper
Using cached pyclipper-1.3.0.post4-cp37-cp37m-win32.whl (85 kB)
Collecting mokuro
Using cached mokuro-0.1.5-py3-none-any.whl (116 kB)
Using cached mokuro-0.1.4-py3-none-any.whl (116 kB)
Using cached mokuro-0.1.3-py3-none-any.whl (114 kB)
Using cached mokuro-0.1.2-py3-none-any.whl (114 kB)
Collecting onnx-simplifier>=0.3.6
Using cached onnx-simplifier-0.4.13.tar.gz (18.1 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "", line 36, in
File "", line 34, in
File "C:\Users\OWNER\AppData\Local\Temp\pip-install-jxl36kkh\onnx-simplifier_80104d44712b436a94ebb1f96f86acef\setup.py", line 65, in
assert CMAKE, 'Could not find "cmake" executable!'
AssertionError: Could not find "cmake" executable!
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

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.