Code Monkey home page Code Monkey logo

docextractor's Introduction

docExtractor

Pytorch implementation of "docExtractor: An off-the-shelf historical document element extraction" paper (accepted at ICFHR 2020 as an oral)

Check out our paper and webpage for details!

teaser.jpg

If you find this code useful, don't forget to star the repo โญ and cite the paper:

@inproceedings{monnier2020docExtractor,
  title={{docExtractor: An off-the-shelf historical document element extraction}},
  author={Monnier, Tom and Aubry, Mathieu},
  booktitle={ICFHR},
  year={2020},
}

Installation ๐Ÿ‘ท

Prerequisites

Make sure you have Anaconda installed (version >= to 4.7.10, you may not be able to install correct dependencies if older). If not, follow the installation instructions provided at https://docs.anaconda.com/anaconda/install/.

1. Create conda environment

conda env create -f environment.yml
conda activate docExtractor

2. Download resources and models

The following command will download:

  • our trained model
  • SynDoc dataset: 10k generated images with line-level page segmentation ground truth
  • synthetic resources needed to generate SynDoc (manually collected ones and Wikiart dataset)
  • IlluHisDoc dataset
./download.sh

NB: it may happen that gdown hangs, if so you can download them by hand, then unzip and move them to appropriate folders (see corresponding scripts):

How to use ๐Ÿš€

There are several main usages you may be interested in:

  1. perform element extraction (off-the-shelf using our trained network or a fine-tuned one)
  2. build our segmentation method from scratch
  3. fine-tune network on custom datasets

Demo: in the demo folder, we provide a jupyter notebook and its html version detailing a step-by-step pipeline to predict segmentation maps for a given image.

preview.png

1. Element extraction

CUDA_VISIBLE_DEVICES=gpu_id python src/extractor.py --input_dir inp --output_dir out

Main args

  • -i, --input_dir: directory where images to process are stored (e.g. raw_data/test)
  • -o, --output_dir: directory where extracted elements will be saved (e.g. results/output)
  • -t, --tag: model tag to use for extraction (default is our trained network)
  • -l, --labels: labels to extract (default corresponds to illustration and text labels)
  • -s, --save_annot: whether to save full resolution annotations while extracting

Additionals

  • -sb, --straight_bbox: whether to use straight bounding boxes instead of rotated ones to fit connected components
  • -dm, --draw_margin: Draw the margins added during extraction (for visual or debugging purposes)

NB: check src/utils/constant.py for labels mapping
NB: the code will automatically run on CPU if no GPU are provided/found

2. Build our segmentation method from scratch

This would result in a model similar to the one located in models/default/model.pkl.

a) Generate SynDoc dataset

You can skip this step if you have already downloaded SynDoc using the script above.

python src/syndoc_generator.py -d dataset_name -n nb_train --merged_labels
  • -d, --dataset_name: name of the resulting synthetic dataset
  • -n, --nb_train: nb of training samples to generate (0.1 x nb_train samples are generated for val and test splits)
  • -m, --merged_labels: whether to merge all graphical and textual labels into unique illustration and text labels

b) Train neural network on SynDoc

CUDA_VISIBLE_DEVICES=gpu_id python src/trainer.py --tag tag --config syndoc.yml

3. Fine-tune network on custom datasets

To fine-tune on a custom dataset, you have to:

  1. annotate a dataset pixel-wise: we recommend using VGG Image Anotator (link) and our ViaJson2Image tool
  2. split dataset in train, val, test and move it to datasets folder
  3. create a configs/example.yml config with corresponding dataset name and a pretrained model name (e.g. default)
  4. train segmentation network with python src/trainer.py --tag tag --config example.yml

Then you can perform extraction with the fine-tuned network by specifying the model tag.

NB: val and test splits can be empty, you just won't have evaluation metrics

Annex tools ๐Ÿ› ๏ธ

1. ViaJson2Image - Convert VIA annotations into segmentation map images

python src/via_converter.py --input_dir inp --output_dir out --file via_region_data.json

NB: by default, it converts regions using the illustration label

2. SyntheticLineGenerator - Generate a synthetic line dataset for OCR training

python src/synline_generator.py -d dataset_name -n nb_doc

NB: you may want to remove text translation augmentations by modifying synthetic.element.TEXT_FONT_TYPE_RATIO.

3. IIIFDownloader - Download IIIF images data from manifest urls

python src/iiif_downloader.py -f filename.txt -o output_dir --width W --height H
  • -f, --file: file where each line contains an url to a json manifest
  • -o, --output_dir: directory where downloaded images will be saved
  • --width and --height: image width and height respectively (default is full resolution)

NB: Be aware that if both width and height arguments are specified, aspect ratio won't be kept. Common usage is to specify a fixed height only.

docextractor's People

Contributors

monniert 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docextractor's Issues

from line level to word level?

Hi. docExtractor is doing a great job! Any suggestions for getting from the line level to individual word level? Does this capability perhaps exist already? Or could you make any recommendations -- either for augmenting docExtractor or perhaps something that already exists in python elsewhere?

Post-processing step

Hi @monniert

Thank you very much for sharing the code with us.

When running the "tester.py" script, the results are obtained by using only the trained model or the trained model followed by the post-processing step?

Thank you in advance

Demo website down

Hi!
I read your paper and viewed your video with interest, and I would like to explore using your code for my application - getting layout segmentation from ~100-year-old newspapers. So I downloaded the repo, but in trying to set up the Anaconda environment, I discovered that you are using a number of dependencies that are Linux specific and not available for Windows. If there are no versions available for Windows, I can set up Windows Subsystem for Linux (WSL) and use it that way. But I really would like to see how your code can handle some of examples of images of newspaper pages before I go to the trouble of setting WSL up. So I went to your demo website - https://enherit.paris.inria.fr/ to see if I could use it for this evaluation - but it is down. Could you please establish a new demo website so I can evaluate your repo?
Thanks!

[suggestion] loading the data on the fly

A good suggestion would be an option of loading the data on the fly, which means instead of loading all the images for training/ predicting all-at-once into the memory, we only load the data as portions.
Even-though this option might increase the time to process the data, it is surely beneficial when dealing with huge number of images for training/predicting, and thus ensuring the ability to deal with huge datasets while maintaining the ram usage.

examples:
--train_on_fly_images 100: 100 images to be loaded into the ram at a single time
--train_on_fly_json 10: a complete 10 json files to be loaded into the ram at a single timeNote:train_on_fly_json` would be used when having multiple .json files for training.
a single .json file can containing multiple images.

conda conflicts

Hi guys,

I really like your work and want to use it in my project. But a big problem I have right now is the conda environment... I tried to setup the environment with your environment.yml but I got a HUGE BUNCH of package conflicts.

Is there anything I'm missing? Or the environment is indeed inconsistent and I can just do it with pip while ignoring all the conflicts?

I'm using Anaconda 4.7.10

Thanks for your time!

Greetings from Germany,
Nicole

Training a Text-Line detector and want to create annotations with x-height+ border automatically

@monniert
I trained a text-line detector model, the accuracy seemed high, but when i tested, the results were very bad. i even tried training at different image sizes, but still the results were not good.
My Guess is that the ground truth should not be all in the same color "cyan", you might need to choose 2 colors, example: first line "cyan", then second line "red", then 3rd line "cyan", then 4th line "red", etc..... This might help in separating close regions.

possible solution:
image

Example:
19699_annotated

Groundtruth:
19699_seg

Original image:
19699

The process of GT generation

First of all, thank you very much for your work! docExtractor extracts text lines very well out of the box.
But I want to fine-tune the model with custom data and I think my question is related to the process of creating the GT.
As you stated in #10 you recommend to add some border around the annotated text lines. As I went through the examples on https://enherit.paris.inria.fr/ it seems that borders are not annotated explicitly.

  • Should borders be annotated (labeled as border) or do you recommend adding them via morphological operations in some kind of a post-process?

Moreover I'm not quite sure which labels where used when the model has been trained. On https://enherit.paris.inria.fr/ the text lines are labeled as text but the paper states labels like paragraph or table.

  • What labels should be used when using the default model as a pretrained model?

In my case I work with tabular data. Should text inside the cells therefore be labeled as table?
Screenshot from 2021-01-28 20-54-21

Thank you in advance!

Problem with PolynomialLR

Thank you very much for sharing the code with us. Recently, I inspect and test all the code that you provided. I notice that your custom PolynomialLR inside the schedulers packet returns the result the same as the ConstantLR does. Please let me know if it is a bug. Thank you in advance.

[bug] translation.exception.TranslateError: No translation get, you may retry

@monniert The error:

(docExtractor) home@home-lnx:~/programs/docExtractor$ python src/syndoc_generator.py -d testing -n 100 --merged_labels
[2020-11-29 00:49:37] Creating train set...
[2020-11-29 00:49:37]   Generating random document with seed 0...
Traceback (most recent call last):
  File "src/syndoc_generator.py", line 62, in <module>
    gen.run(args.nb_train)
  File "src/syndoc_generator.py", line 46, in run
    d = SyntheticDocument(**kwargs)
  File "/home/home/programs/docExtractor/src/utils/__init__.py", line 74, in wrapper
    return f(*args, **kw)
  File "/home/home/programs/docExtractor/src/synthetic/document.py", line 126, in __init__
    self.elements, self.positions = self._generate_random_layout()
  File "/home/home/programs/docExtractor/src/utils/__init__.py", line 74, in wrapper
    return f(*args, **kw)
  File "/home/home/programs/docExtractor/src/synthetic/document.py", line 238, in _generate_random_layout
    element = choice(self.available_elements, p=weights)(width, height, **element_kwargs)
  File "/home/home/programs/docExtractor/src/synthetic/element.py", line 151, in __init__
    self.generate_content(seed=seed)
  File "/home/home/programs/docExtractor/src/utils/__init__.py", line 74, in wrapper
    return f(*args, **kw)
  File "/home/home/programs/docExtractor/src/synthetic/element.py", line 597, in generate_content
    self.text, content_width, content_height = self.format_text(text)
  File "/home/home/programs/docExtractor/src/synthetic/element.py", line 624, in format_text
    text = google(text, src='en', dst='ar')
  File "/home/home/anaconda3/envs/docExtractor/lib/python3.6/site-packages/translation/__init__.py", line 19, in google
    dst = dst, proxies = proxies)
  File "/home/home/anaconda3/envs/docExtractor/lib/python3.6/site-packages/translation/main.py", line 33, in get
    if r == '': raise TranslateError('No translation get, you may retry')
translation.exception.TranslateError: No translation get, you may retry

Listing the folder's tree:

(docExtractor) home@home-lnx:~/programs/docExtractor$ tree -d
.
โ”œโ”€โ”€ configs
โ”œโ”€โ”€ demo
โ”œโ”€โ”€ models
โ”‚ย ย  โ””โ”€โ”€ default
โ”œโ”€โ”€ raw_data
โ”‚ย ย  โ””โ”€โ”€ illuhisdoc
โ”‚ย ย      โ”œโ”€โ”€ msd
โ”‚ย ย      โ”œโ”€โ”€ msi
โ”‚ย ย      โ”œโ”€โ”€ mss
โ”‚ย ย      โ”œโ”€โ”€ p
โ”‚ย ย      โ””โ”€โ”€ via_json
โ”œโ”€โ”€ scripts
โ”œโ”€โ”€ src
โ”‚ย ย  โ”œโ”€โ”€ datasets
โ”‚ย ย  โ”œโ”€โ”€ loss
โ”‚ย ย  โ”œโ”€โ”€ models
โ”‚ย ย  โ”œโ”€โ”€ optimizers
โ”‚ย ย  โ”œโ”€โ”€ schedulers
โ”‚ย ย  โ”œโ”€โ”€ synthetic
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ __pycache__
โ”‚ย ย  โ””โ”€โ”€ utils
โ”‚ย ย      โ””โ”€โ”€ __pycache__
โ””โ”€โ”€ synthetic_resource
    โ”œโ”€โ”€ background
    โ”‚ย ย  โ”œโ”€โ”€ 0
    โ”‚ย ย  โ”œโ”€โ”€ 10
    โ”‚ย ย  โ”œโ”€โ”€ 100
    โ”‚ย ย  โ”œโ”€โ”€ 110
    โ”‚ย ย  โ”œโ”€โ”€ 120
    โ”‚ย ย  โ”œโ”€โ”€ 20
    โ”‚ย ย  โ”œโ”€โ”€ 30
    โ”‚ย ย  โ”œโ”€โ”€ 40
    โ”‚ย ย  โ”œโ”€โ”€ 50
    โ”‚ย ย  โ”œโ”€โ”€ 60
    โ”‚ย ย  โ”œโ”€โ”€ 70
    โ”‚ย ย  โ”œโ”€โ”€ 80
    โ”‚ย ย  โ””โ”€โ”€ 90
    โ”œโ”€โ”€ context_background
    โ”œโ”€โ”€ drawing
    โ”œโ”€โ”€ drawing_background
    โ”œโ”€โ”€ font
    โ”‚ย ย  โ”œโ”€โ”€ arabic
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Amiri
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Arial
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Cairo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ dejavu_dejavu-sans
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ El_Messiri
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ gnu-freefont_freeserif
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ st-gigafont-typefaces_code2003
    โ”‚ย ย  โ”œโ”€โ”€ chinese
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Liu_Jian_Mao_Cao
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Long_Cang
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Ma_Shan_Zheng
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Noto_Sans_SC
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Noto_Serif_SC
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ ZCOOL_KuaiLe
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ ZCOOL_QingKe_HuangYou
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ ZCOOL_XiaoWei
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Zhi_Mang_Xing
    โ”‚ย ย  โ”œโ”€โ”€ foreign_like
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ alhambra
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ barmee_afarat-ibn-blady
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bizancia
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ catharsis_bedouin
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ catharsis_catharsis-bedouin
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ k22_timbuctu
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ kingthings_conundrum
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ meifen
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ ming_imperial
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ running_smobble
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ samarkan
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ selamet_lebaran
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ uddi-uddi_running-smobble
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ yozakura
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ zilap_oriental
    โ”‚ย ย  โ”œโ”€โ”€ handwritten
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Alako
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Angelina
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ anke-print
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ atlandsketches-bb
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bathilda
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ BlackJack_Regular
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ blzee
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ bromello
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ calligravity
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Carefree
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ conformity
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Cursive_standard
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Damion
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Elegant
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ emizfont
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ hoffmanhand
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ honey_script
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ hurryup
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ irezumi
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ james-tan-dinawanao
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ JaneAusten
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Jellyka_-_Love_and_Passion
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ jr-hand
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Juergen
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ khand
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ kosal-says-hy
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Learning_Curve
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Learning_Curve_Pro
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ maddison_signature
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ may-queen
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ mistis-fonts_october-twilight
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ mistis-fonts_stylish-calligraphy-demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ mistis-fonts_watermelon-script-demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Monika
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ mumsies
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ nymphont_xiomara
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ otto
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Otto
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Pacifico
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ paul_signature
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ pecita
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ popsies
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ quigleywiggly
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ rabiohead
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ roddy
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Saginaw
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Saginaw 2
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ santos-dumont
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ scribble
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ scriptina
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sf-burlington-script
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ TrueType
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sf-foxboro-script
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ TrueType
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ shadows-into-light
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ shartoll-light
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ shelter-me
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ kimberly-geswein_shelter-me
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ shorelines_script
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ signerica
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sild
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ silent-fighter
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Silent Fighter
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sillii_willinn
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ silverline-script-demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ simple-signature
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ snake
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Snake
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ somes-style
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sophia-bella-demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ spitter
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Spitter
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ stalemate
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ standard-pilot-demo
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ standard pilot demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ stingray
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Stingray
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ stylish-marker
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Sudestada
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sunshine-in-my-soul
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ kimberly-geswein_sunshine-in-my-soul
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sweet-lady
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Tabitha
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ the-girl-next-door
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ the-great-escape
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ kimberly-geswein_the-great-escape
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ the-illusion-of-beauty
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ theodista-decally
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ the-only-exception
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ kimberly-geswein_the-only-exception
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ the-queenthine
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ The Queenthine demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ the_wave
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ think-dreams
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ toubibdemo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ turkeyface
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ typhoon-type-suthi-srisopha_sweet-hipster
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ undercut
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ variane-script
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ velocity-demo
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ vengeance
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ victorisa
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ waiting-for-the-sunrise
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ watasyina
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ westbury-signature-demo-version
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Westbury-Signature-Demo-Version
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ white_angelica
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ wiegel-kurrent
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ wiegel-latein
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ Windsong
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ winkdeep
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ wolgast-two
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ wonder_bay
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ written-on-his-hands
    โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ kimberly-geswein_written-on-his-hands
    โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ you-wont-bring-me-down
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ zeyada
    โ”‚ย ย  โ””โ”€โ”€ normal
    โ”‚ย ย      โ”œโ”€โ”€ alexey-kryukov_theano
    โ”‚ย ย      โ”œโ”€โ”€ daniel-johnson_didact-gothic
    โ”‚ย ย      โ”œโ”€โ”€ david-perry_cardo
    โ”‚ย ย      โ”œโ”€โ”€ dejavu_dejavu-sans
    โ”‚ย ย      โ”œโ”€โ”€ dejavu_dejavu-serif
    โ”‚ย ย      โ”œโ”€โ”€ ek-type_ek-mukta
    โ”‚ย ย      โ”œโ”€โ”€ georg-duffner_eb-garamond
    โ”‚ย ย      โ”œโ”€โ”€ gnu-freefont_freemono
    โ”‚ย ย      โ”œโ”€โ”€ gnu-freefont_freesans
    โ”‚ย ย      โ”œโ”€โ”€ gnu-freefont_freeserif
    โ”‚ย ย      โ”œโ”€โ”€ google_noto-sans
    โ”‚ย ย      โ”œโ”€โ”€ google_noto-serif
    โ”‚ย ย      โ”œโ”€โ”€ google_roboto
    โ”‚ย ย      โ”œโ”€โ”€ gust-e-foundry_texgyreschola
    โ”‚ย ย      โ”œโ”€โ”€ gust-e-foundry_texgyretermes
    โ”‚ย ย      โ”œโ”€โ”€ james-kass_code2000
    โ”‚ย ย      โ”œโ”€โ”€ kineticplasma-fonts_din-kursivschrift
    โ”‚ย ย      โ”œโ”€โ”€ kineticplasma-fonts_falling-sky
    โ”‚ย ย      โ”œโ”€โ”€ kineticplasma-fonts_mechanical
    โ”‚ย ย      โ”œโ”€โ”€ kineticplasma-fonts_trueno
    โ”‚ย ย      โ”œโ”€โ”€ linux-libertine_linux-libertine
    โ”‚ย ย      โ”œโ”€โ”€ m-fonts_m-2p
    โ”‚ย ย      โ”œโ”€โ”€ nymphont_aver
    โ”‚ย ย      โ”œโ”€โ”€ red-hat-inc_liberation-sans
    โ”‚ย ย      โ”œโ”€โ”€ sil-international_charis-sil
    โ”‚ย ย      โ”œโ”€โ”€ sil-international_doulos-sil
    โ”‚ย ย      โ”œโ”€โ”€ sil-international_doulos-sil-compact
    โ”‚ย ย      โ”œโ”€โ”€ sil-international_gentium-book-basic
    โ”‚ย ย      โ”œโ”€โ”€ sil-international_gentium-plus
    โ”‚ย ย      โ””โ”€โ”€ st-gigafont-typefaces_code2003
    โ”œโ”€โ”€ glyph_font
    โ”‚ย ย  โ”œโ”€โ”€ ababil-script-demo
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ MJ Ababil Demo
    โ”‚ย ย  โ”œโ”€โ”€ aldus_regal
    โ”‚ย ย  โ”œโ”€โ”€ aldus_romant
    โ”‚ย ย  โ”œโ”€โ”€ aldus_royal
    โ”‚ย ย  โ”œโ”€โ”€ anglo-text
    โ”‚ย ย  โ”œโ”€โ”€ art-designs-by-sue_fairies-gone-wild
    โ”‚ย ย  โ”œโ”€โ”€ art-designs-by-sue_fairies-gone-wild-plus
    โ”‚ย ย  โ”œโ”€โ”€ camelotcaps
    โ”‚ย ย  โ”œโ”€โ”€ cameoappearance
    โ”‚ย ย  โ”œโ”€โ”€ character_cherubic-initials
    โ”‚ย ย  โ”œโ”€โ”€ character_masselleam
    โ”‚ย ย  โ”œโ”€โ”€ character_romantique-initials
    โ”‚ย ย  โ”œโ”€โ”€ cheap-stealer
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ cheap stealer
    โ”‚ย ย  โ”œโ”€โ”€ cheshire-initials
    โ”‚ย ย  โ”œโ”€โ”€ chung-deh-tien-chase-zen_chase-zen-jingletruck-karachi
    โ”‚ย ย  โ”œโ”€โ”€ cloutierfontes_british-museum-1490
    โ”‚ย ย  โ”œโ”€โ”€ colchester
    โ”‚ย ย  โ”œโ”€โ”€ dan-roseman_chaucher
    โ”‚ย ย  โ”œโ”€โ”€ decorated-roman-initials
    โ”‚ย ย  โ”œโ”€โ”€ digital-type-foundry_burton
    โ”‚ย ย  โ”œโ”€โ”€ dominatrix
    โ”‚ย ย  โ”œโ”€โ”€ ds-romantiques
    โ”‚ย ย  โ”œโ”€โ”€ egyptienne-zierinitialien
    โ”‚ย ย  โ”œโ”€โ”€ ehmcke-fraktur-initialen
    โ”‚ย ย  โ”œโ”€โ”€ ehmcke-schwabacher-initialen
    โ”‚ย ย  โ”œโ”€โ”€ elzevier-caps
    โ”‚ย ย  โ”œโ”€โ”€ eva-barabasne-olasz_kahirpersonaluse
    โ”‚ย ย  โ”œโ”€โ”€ extraornamentalno2
    โ”‚ย ย  โ”œโ”€โ”€ fleurcornercaps
    โ”‚ย ย  โ”œโ”€โ”€ flowers-initials
    โ”‚ย ย  โ”œโ”€โ”€ gate-and-lock-co_metalover
    โ”‚ย ย  โ”œโ”€โ”€ gemfonts_gothic-illuminate
    โ”‚ย ย  โ”œโ”€โ”€ genzsch-initials
    โ”‚ย ย  โ”œโ”€โ”€ george-williams_andrade
    โ”‚ย ย  โ”œโ”€โ”€ george-williams_floral-caps-nouveau
    โ”‚ย ย  โ”œโ”€โ”€ george-williams_morris
    โ”‚ย ย  โ”œโ”€โ”€ george-williams_square-caps
    โ”‚ย ย  โ”œโ”€โ”€ germanika-personal-use
    โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ Germanika Personal Use
    โ”‚ย ย  โ”œโ”€โ”€ griffintwo
    โ”‚ย ย  โ”œโ”€โ”€ house-of-lime_fleurcornercaps
    โ”‚ย ย  โ”œโ”€โ”€ house-of-lime_german-caps
    โ”‚ย ย  โ”œโ”€โ”€ house-of-lime_gothic-flourish
    โ”‚ย ย  โ”œโ”€โ”€ house-of-lime_lime-blossom-caps
    โ”‚ย ย  โ”œโ”€โ”€ house-of-lime_limeglorycaps
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_centennialscriptfancy-three
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_hard-to-read-monograms
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_holbeinchildrens
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_intellecta-monograms-random-eight
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_intellecta-monograms-random-sam
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_intellecta-monograms-random-six
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_intellecta-monograms-random-two
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_jaggard-two
    โ”‚ย ย  โ”œโ”€โ”€ intellecta-design_nardis
    โ”‚ย ย  โ”œโ”€โ”€ jlh-fonts_apex-lake
    โ”‚ย ย  โ”œโ”€โ”€ kaiserzeitgotisch
    โ”‚ย ย  โ”œโ”€โ”€ kanzler
    โ”‚ย ย  โ”œโ”€โ”€ kr-keltic-one
    โ”‚ย ย  โ”œโ”€โ”€ lime-blossom-caps
    โ”‚ย ย  โ”œโ”€โ”€ lord-kyl-mackay_floral-majuscules-11th-c
    โ”‚ย ย  โ”œโ”€โ”€ lord-kyl-mackay_gothic-leaf
    โ”‚ย ย  โ”œโ”€โ”€ lorvad_spatz
    โ”‚ย ย  โ”œโ”€โ”€ manfred-klein_delitschinitialen
    โ”‚ย ย  โ”œโ”€โ”€ manfred-klein_lombardi-caps
    โ”‚ย ย  โ”œโ”€โ”€ manfred-klein_vespasiancaps
    โ”‚ย ย  โ”œโ”€โ”€ manfred-klein_vespasiansflorials
    โ”‚ย ย  โ”œโ”€โ”€ medici-text
    โ”‚ย ย  โ”œโ”€โ”€ medievalalphabet
    โ”‚ย ย  โ”œโ”€โ”€ morris-initialen
    โ”‚ย ย  โ”œโ”€โ”€ napoli-initialen
    โ”‚ย ย  โ”œโ”€โ”€ neugotische-initialen
    โ”‚ย ย  โ”œโ”€โ”€ nouveau-drop-caps
    โ”‚ย ย  โ”œโ”€โ”€ paisleycaps
    โ”‚ย ย  โ”œโ”€โ”€ pamela
    โ”‚ย ย  โ”œโ”€โ”€ panhead
    โ”‚ย ย  โ”œโ”€โ”€ paulus-franck-initialen
    โ”‚ย ย  โ”œโ”€โ”€ pau-the-1st
    โ”‚ย ย  โ”œโ”€โ”€ precious
    โ”‚ย ย  โ”œโ”€โ”€ rediviva
    โ”‚ย ย  โ”œโ”€โ”€ rothenburg-decorative
    โ”‚ย ย  โ”œโ”€โ”€ royal-initialen
    โ”‚ย ย  โ”œโ”€โ”€ rudelsberg
    โ”‚ย ย  โ”œโ”€โ”€ sentinel
    โ”‚ย ย  โ”œโ”€โ”€ sniper
    โ”‚ย ย  โ”œโ”€โ”€ spring
    โ”‚ย ย  โ”œโ”€โ”€ the-black-box_seven-waves-sighs-salome
    โ”‚ย ย  โ”œโ”€โ”€ tulips
    โ”‚ย ย  โ”œโ”€โ”€ typographerwoodcutinitialsone
    โ”‚ย ย  โ”œโ”€โ”€ unger-fraktur-zierbuchstaben
    โ”‚ย ย  โ”œโ”€โ”€ victorian-initials-one
    โ”‚ย ย  โ”œโ”€โ”€ vtks-deja-vu
    โ”‚ย ย  โ”œโ”€โ”€ vtks-focus
    โ”‚ย ย  โ”œโ”€โ”€ vtks-mercearia
    โ”‚ย ย  โ”œโ”€โ”€ vtks-simplex-beauty-2
    โ”‚ย ย  โ”œโ”€โ”€ vtks-sonho
    โ”‚ย ย  โ”œโ”€โ”€ vtks-velhos-tempos
    โ”‚ย ย  โ”œโ”€โ”€ waste-of-paint
    โ”‚ย ย  โ”œโ”€โ”€ west-wind-fonts_exotica
    โ”‚ย ย  โ”œโ”€โ”€ west-wind-fonts_leafy
    โ”‚ย ย  โ”œโ”€โ”€ zallman-caps
    โ”‚ย ย  โ””โ”€โ”€ zamolxis_zamolxisornament
    โ”œโ”€โ”€ noise_pattern
    โ”‚ย ย  โ”œโ”€โ”€ border_hole
    โ”‚ย ย  โ”œโ”€โ”€ center_hole
    โ”‚ย ย  โ”œโ”€โ”€ corner_hole
    โ”‚ย ย  โ””โ”€โ”€ phantom_character
    โ”œโ”€โ”€ text
    โ””โ”€โ”€ wikiart
        โ”œโ”€โ”€ Abstract_Expressionism
        โ”œโ”€โ”€ Action_painting
        โ”œโ”€โ”€ Analytical_Cubism
        โ”œโ”€โ”€ Art_Nouveau_Modern
        โ”œโ”€โ”€ Baroque
        โ”œโ”€โ”€ Color_Field_Painting
        โ”œโ”€โ”€ Contemporary_Realism
        โ”œโ”€โ”€ Cubism
        โ”œโ”€โ”€ Early_Renaissance
        โ”œโ”€โ”€ Expressionism
        โ”œโ”€โ”€ Fauvism
        โ”œโ”€โ”€ High_Renaissance
        โ”œโ”€โ”€ Impressionism
        โ”œโ”€โ”€ Mannerism_Late_Renaissance
        โ”œโ”€โ”€ Minimalism
        โ”œโ”€โ”€ Naive_Art_Primitivism
        โ”œโ”€โ”€ New_Realism
        โ”œโ”€โ”€ Northern_Renaissance
        โ”œโ”€โ”€ Pointillism
        โ”œโ”€โ”€ Pop_Art
        โ”œโ”€โ”€ Post_Impressionism
        โ”œโ”€โ”€ Realism
        โ”œโ”€โ”€ Rococo
        โ”œโ”€โ”€ Romanticism
        โ”œโ”€โ”€ Symbolism
        โ”œโ”€โ”€ Synthetic_Cubism
        โ””โ”€โ”€ Ukiyo_e

362 directories

via_converter.py generate with boarders

@monniert
i generated the groundtruth masks using the via_converter.py script that you included, they are created without the boarders, as when i used Via Annotator i was boxing the textlines.
i think it would be better to add the option to generate with boarders when using via_converter.py.

bug -- tester.py

Hi @monniert

Thank you very much for sharing the code with us.

When running the "tester.py" script, there is the following bug related to Image.blend (Ihave checked that pred_img.size = img.size). Is it related to resize function ?

(926, 1280)
(926, 1280)
Traceback (most recent call last):
File "tester.py", line 122, in
tester.run()
File "tester.py", line 66, in run
self.save_prob_and_seg_maps()
File "tester.py", line 101, in save_prob_and_seg_maps
blend_img = Image.blend(img, pred_img, alpha=0.4)
File "/home/pejc/anaconda2/envs/layout/lib/python3.8/site-packages/PIL/Image.py", line 3011, in blend
return im1._new(core.blend(im1.im, im2.im, alpha))
ValueError: images do not match

Thank you in advance

can't get wikiart.zip to download

Hi. Thanks for the great tool!

I can't get the wikiart.zip to download. First I was running the script included in the package, but it would always time out. Then I went directly to , but I get a message (in Chrome) that "this site can't be reached."

Is there any other way to obtain this resource?

Thanks in advance.

[donate] include FUNDING.yml to accept donations

This project seems interesting, and in-order to insure the continuity of development and improvement i would suggest adding a FUNDING.yml so that you can accept donations.

My main interest in this project:

  • Simplicity and straightforwardness: directly input .json files and start training/finetuning. directly predict and output .json file.
  • Scalability and efficiency: the training/predicting data might contain millions of images, therefore it would be reasonable instead of preloading all the data during the training, to only load the data on the fly, meaning the required number of files.

Does these suggestions align with the goal of this project?
Do you accept donations?

where is the UI?

I'm going through the code and I can't figure out how to run the UI.

I saw that the demo is down and that you are not able to bring it back up (issue #18 ). So I tried to do it myself but I only see the code to segment the regions. In the video it seems that there is some sort of UI to navigate the book and the annotated regions. How can I start that program/server?

quality/resolution of image results

Hello again.

The images that result from running docExtractor (as found in the "text" and "illustration" folders) -- should I expect these to be full resolution with respect to the original? Or is some reduction or loss involved?

(I did my own little (if crude) test. Here is a clip resulting from docExtractor:

Folio_015v_22

The file size is 33.7 KB.

Here is a crop I made from the original:

Folio_015_linetest

The file size is 70.4 KB.

I confess I don't know enough about digital imagery, how files are saved, etc to know if this concludes anything or not. :) Regardless, my goal is to have crops made using docExtractor that are lossless.)

[bug] KeyError: 'filename'

input.zip

(docExtractor) home@home-lnx:~/programs/docExtractor$ python src/via_converter.py --input_dir input/ --output_dir output/ --file ./test.json 
Traceback (most recent call last):
  File "src/via_converter.py", line 80, in <module>
    conv.run()
  File "src/via_converter.py", line 36, in run
    img = self.convert(annot)
  File "src/via_converter.py", line 41, in convert
    name = annot['filename']
KeyError: 'filename'

[suggestion] Store datasets and models in a data archive

It would be great if you could store generated models and datasets that you collected in an archive like Zenodo. Zenodo would give the dataset (which requires a bit of metadata) a DOI for easier citation and it provides stronger long-term promises than Google Drive or Dropbox. (IMHO providing Google Drive links for important data looks phishy, although I know many other projects do the same.)

Thanks for your consideration!

Parallel Prediction?

Hi @monniert,

Good day :)

I'm using docExtractor in my project to extract textlines. Problem is, I have a LOT of pages. Therefore I'm planning on using multiprocessing to do it in parallel. Is it already an option in this project? Or do you have any suggestions on improving the efficiency of such extraction for me?

Thanks a lot!

Best,
Nicole

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.