GithubHelp home page GithubHelp logo

dmmaze / comic-text-detector Goto Github PK

View Code? Open in Web Editor NEW
197.0 197.0 39.0 10.03 MB

Manga&Comic text detection

License: GNU General Public License v3.0

Python 96.99% Jupyter Notebook 3.01%
anime comics computer-vision deep-learning manga-translation object-detection ocr scene-text-detection weak-supervision weakly-supervised-segmentation

comic-text-detector's People

Contributors

dmmaze avatar kianmeng 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

comic-text-detector's Issues

Numpy 1.24+ incompatibilities

Hey I've been trying to get a command line tool which makes use of comic text detector to work, but I ran into some version incompatibilities I thought I should quickly mention.

On Numpy 1.23 your code seems to run just fine, however things break on the latest version 1.24 (which gets installed by default).
The problem seems to be that Numpy version 1.24+ removes the np.int alias.

Would be great if you could replace all uses of np.int with a suitable alternative? πŸ˜…
Not 100% sure but I think it's safe to replace np.int with np.int_ or just regular int (from my understanding of the problem)

TypeError: load_dict() got an unexpected keyword argument 'lang'

File ~/imt/comic-text-detector/text_rendering.py:170, in TextLinesSampler.init(self, page_size, sampler_dict)
168 self.page_w, self.page_h = page_size
169 self.lang = sampler_dict['lang']
--> 170 self.lang_dict = load_dict(lang=self.lang)
171 self.orientation_sampler = ScaledSampler(sampler_dict['orientation'])
172 self.numlines_sampler = ScaledSampler(sampler_dict['num_lines'])

TypeError: load_dict() got an unexpected keyword argument 'lang'

In example.ipynb file, the code isn't work with error messages.
what can I do??

Missing font .csv files

Static font files are missing for text rendering data/font_statics_en.csv and data/font_statics_jp.csv

Are image segmentations necessary for training?

I'm interested in leveraging features learned on Japanese manga to do transfer learning on the problem of detecting individual characters in a dataset of handwritten Japanese. While looking through the train_*.py scripts, I saw that you were providing a train_mask_dir argument. I realize that one of the outputs of comic-text-detector is an image mask so it makes sense that the model was trained on image segmentations annotations but I'm only interested in the text block detection module. How can I check out a model pretrained on comics and then fine-tune it with my dataset?

Auxiliary to this, you mention that β€œAll models were trained on around 13 thousand anime & comic style images, 1/3 from Manga109-s” in the README. Does this mean that the entirety of Manga109-s was used during training and that the whole Manga109-s composed a third of the overall training dataset or that you only took one third of Manga-109s and then used this smaller subsample of Manga-109s in your overall training data? I'm wondering because Manga-109s does not provide image segmentation annotations. Did you just use the bounding box annotations or did you make use of the Manga109 image segmentation annotations made in the paper Unconstrained Text Detection in Manga?

Running into an issue trying to run just the first block of the notebook

ValueError                                Traceback (most recent call last)
Cell In[2], line 7
      5 img_dir = r'data/examples'                              # can be dir list
      6 save_dir = r'data/examples/annotations'
----> 7 model2annotations(model_path, img_dir, save_dir, save_json=False)

File ~/comic-text-detector/inference.py:45, in model2annotations(model_path, img_dir_list, save_dir, save_json)
     43     blk_xyxy.append(blk.xyxy)
     44     blk_dict_list.append(blk.to_dict())
---> 45 blk_xyxy = xyxy2yolo(blk_xyxy, im_w, im_h)
     46 if blk_xyxy is not None:
     47     cls_list = [1] * len(blk_xyxy)

File ~/comic-text-detector/utils/imgproc_utils.py:40, in xyxy2yolo(xyxy, w, h)
     39 def xyxy2yolo(xyxy, w: int, h: int):
---> 40     if xyxy == [] or xyxy == np.array([]) or len(xyxy) == 0:
     41         return None
     42     if isinstance(xyxy, list):

ValueError: operands could not be broadcast together with shapes (0,) (24,4) 

Thanks!

For dataset

I would like to train a model in Spanish and I was wondering what dataset was needed? I mean the folder structure.

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.