Giter Club home page Giter Club logo

raw-novel-translation's Introduction

Raw Light Novel Translator

Commit activity Lines of code Contributors

Some light novels will never be translated, therefore this project is born. This project aims to turn Light Novel raws images into translated text

Intallation ๐Ÿฆ„

# First, you need to have Python(>=3.8) installed on your system.
$ python --version
Python 3.8.13

# Clone this repo
$ git clone https://github.com/Snowad14/Raw-Novel-Translation.git

# Install the dependencies
$ pip install -r requirements.txt

Then, download ocr.ckpt, ocr-ctc.ckpt, detect.ckpt, comictextdetector.pt and comictextdetector.pt.onnx from https://github.com/zyddnys/manga-image-translator/releases/, put them in the root directory of this repo.

<!> If you use paid translators put the api key in the file translators/keys.py

Usage ๐Ÿ‘

$ python main.py --use-cuda --translator=google --target-lang=ENG --image <path_to_image_folder>

TODO

Feature/Bugs Finished
Take the pictures in good order [โœ“]
Well integrated sugoi Translator [โŒ]

Credit ๐Ÿ“‹

Fork of https://github.com/zyddnys/manga-image-translator (don't hesitate to make a small donation)

raw-novel-translation's People

Contributors

snowad14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

raw-novel-translation's Issues

[bug] Getting error "TypeError: CustomTransformerEncoderLayer.forward() got an unexpected keyword argument 'is_causal'" whenver running program

Whenever I run the program the following error message. Is there any information you may have on how to fix this. Thanks!

Traceback (most recent call last):
File "C:\Users\USERPC\Downloads\Raw-Novel-Translation-main\Raw-Novel-Translation-main\main.py", line 193, in main
await infer(img, 'demo', '', dst_image_name = dst_filename, alpha_ch = alpha_ch)
File "C:\Users\USERPC\Downloads\Raw-Novel-Translation-main\Raw-Novel-Translation-main\main.py", line 75, in infer
textlines = await dispatch_ocr(img, textlines, args.use_cuda, args, model_name = args.ocr_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\Downloads\Raw-Novel-Translation-main\Raw-Novel-Translation-main\ocr_init_.py", line 253, in dispatch
return run_ocr_48px_ctc(img, cuda, list(generate_text_direction(textlines)), batch_size, verbose = verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\Downloads\Raw-Novel-Translation-main\Raw-Novel-Translation-main\ocr_init_.py", line 163, in run_ocr_48px_ctc
texts = MODEL_48PX_CTC.decode(images, widths, 0, verbose = verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\Downloads\Raw-Novel-Translation-main\Raw-Novel-Translation-main\ocr\model_48px_ctc.py", line 301, in decode
feats = self.encoders(feats.permute(0, 2, 1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\transformer.py", line 387, in forward
output = mod(output, src_mask=mask, is_causal=is_causal, src_key_padding_mask=src_key_padding_mask_for_layers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USERPC\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CustomTransformerEncoderLayer.forward() got an unexpected keyword argument 'is_causal'

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.