yomitoku 0.4.1__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yomitoku-0.4.1 → yomitoku-0.5.0}/PKG-INFO +21 -36
- {yomitoku-0.4.1 → yomitoku-0.5.0}/README.md +17 -32
- yomitoku-0.5.0/README_EN.md +93 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/demo/setting_document_anaysis.py +1 -3
- {yomitoku-0.4.1 → yomitoku-0.5.0}/dockerfile +1 -1
- yomitoku-0.5.0/docs/index.en.md +21 -0
- yomitoku-0.4.1/docs/index.md → yomitoku-0.5.0/docs/index.ja.md +0 -14
- yomitoku-0.5.0/docs/installation.en.md +47 -0
- yomitoku-0.4.1/docs/installation.md → yomitoku-0.5.0/docs/installation.ja.md +15 -24
- yomitoku-0.5.0/docs/usage.en.md +223 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/mkdocs.yml +13 -1
- {yomitoku-0.4.1 → yomitoku-0.5.0}/pyproject.toml +29 -5
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/configs/cfg_text_detector_dbnet.py +1 -1
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/data/functions.py +13 -6
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/document_analyzer.py +4 -10
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/layout_analyzer.py +2 -5
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/dbnet_plus.py +13 -39
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/rtdetr_backbone.py +6 -17
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/rtdetr_hybrid_encoder.py +7 -20
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/parseq.py +6 -19
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/postprocessor/dbnet_postporcessor.py +15 -14
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/postprocessor/parseq_tokenizer.py +1 -3
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/utils/misc.py +1 -1
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/utils/visualizer.py +10 -3
- yomitoku-0.5.0/static/out/demo_html.png +0 -0
- yomitoku-0.5.0/static/out/in_demo_p1.html +86 -0
- yomitoku-0.5.0/static/out/in_demo_p1.md +38 -0
- yomitoku-0.5.0/static/out/in_demo_p1_ocr.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery1_p1.html +92 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_gallery1_p1.md +14 -14
- yomitoku-0.5.0/static/out/in_gallery1_p1_layout.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery1_p1_ocr.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery2_p1.html +230 -0
- yomitoku-0.5.0/static/out/in_gallery2_p1.md +24 -0
- yomitoku-0.5.0/static/out/in_gallery2_p1_layout.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery2_p1_ocr.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery3_p1.html +36 -0
- yomitoku-0.5.0/static/out/in_gallery3_p1_layout.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery3_p1_ocr.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery4_p1.html +44 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_gallery4_p1.md +2 -2
- yomitoku-0.5.0/static/out/in_gallery4_p1_ocr.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery5_p1.html +50 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_gallery5_p1.md +10 -12
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_gallery5_p1_layout.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery5_p1_ocr.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery6_p1.html +79 -0
- yomitoku-0.5.0/static/out/in_gallery6_p1.md +32 -0
- yomitoku-0.5.0/static/out/in_gallery6_p1_layout.jpg +0 -0
- yomitoku-0.5.0/static/out/in_gallery6_p1_ocr.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_base.py +1 -4
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_document_analyzer.py +6 -18
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_layout_analyzer.py +2 -6
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_ocr.py +3 -8
- {yomitoku-0.4.1 → yomitoku-0.5.0}/uv.lock +243 -203
- yomitoku-0.4.1/static/out/demo_html.png +0 -0
- yomitoku-0.4.1/static/out/in_demo_p1.html +0 -86
- yomitoku-0.4.1/static/out/in_demo_p1.md +0 -38
- yomitoku-0.4.1/static/out/in_demo_p1_ocr.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery1_p1_layout.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery1_p1_ocr.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery2_p1.md +0 -24
- yomitoku-0.4.1/static/out/in_gallery2_p1_layout.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery2_p1_ocr.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery3_p1_layout.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery3_p1_ocr.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery4_p1_ocr.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery5_p1_ocr.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery6_p1.md +0 -34
- yomitoku-0.4.1/static/out/in_gallery6_p1_layout.jpg +0 -0
- yomitoku-0.4.1/static/out/in_gallery6_p1_ocr.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.github/release-drafter.yml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.github/workflows/build-and-publish-docs.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.github/workflows/build-and-publish.yml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.github/workflows/create-release.yml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.github/workflows/lint-and-test.yml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.gitignore +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.pre-commit-config.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/.python-version +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/configs/layout_parser_rtdetrv2.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/configs/table_structure_recognitizer.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/configs/text_detector.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/configs/text_recognizer.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/demo/sample.pdf +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/demo/simple_document_analysis.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/demo/simple_layout.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/demo/simple_ocr.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/demo/text_detector.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/docs/assets/logo.svg +0 -0
- yomitoku-0.4.1/docs/usage.md → yomitoku-0.5.0/docs/usage.ja.md +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/gallery.md +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/pytest.ini +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/scripts/register_hugging_face_hub.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/base.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/cli/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/cli/main.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/configs/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/configs/cfg_layout_parser_rtdtrv2.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/configs/cfg_table_structure_recognizer_rtdtrv2.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/configs/cfg_text_recognizer_parseq.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/constants.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/data/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/data/dataset.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/export/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/export/export_csv.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/export/export_html.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/export/export_json.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/export/export_markdown.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/layout_parser.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/activate.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/dbnet_feature_attention.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/parseq_transformer.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/layers/rtdetrv2_decoder.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/models/rtdetr.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/ocr.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/postprocessor/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/postprocessor/rtdetr_postprocessor.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/reading_order.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/resource/MPLUS1p-Medium.ttf +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/resource/charset.txt +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/table_structure_recognizer.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/text_detector.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/text_recognizer.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/utils/__init__.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/utils/graph.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/src/yomitoku/utils/logger.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/demo.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/gallery1.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/gallery2.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/gallery3.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/gallery4.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/gallery5.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/in/gallery6.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/logo/horizontal.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_demo_p1_figure_0.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_0.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_1.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_10.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_2.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_3.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_4.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_5.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_6.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_7.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_8.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery1_p1_figure_9.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery3_p1_figure_0.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery3_p1_figure_1.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery5_p1_figure_0.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery5_p1_figure_1.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery6_p1_figure_0.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/figures/in_gallery6_p1_figure_1.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_demo_p1_layout.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_gallery3_p1.md +2 -2
- {yomitoku-0.4.1 → yomitoku-0.5.0}/static/out/in_gallery4_p1_layout.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/invalid.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/invalid.pdf +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/rgba.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/small.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/subdir/test.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test.bmp +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test.pdf +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test.png +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test.tiff +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test.txt +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/data/test_gray.jpg +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_cli.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_data.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/test_export.py +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/yaml/layout_parser.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/yaml/table_structure_recognizer.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/yaml/text_detector.yaml +0 -0
- {yomitoku-0.4.1 → yomitoku-0.5.0}/tests/yaml/text_recognizer.yaml +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: yomitoku
|
3
|
-
Version: 0.
|
4
|
-
Summary: Yomitoku is
|
3
|
+
Version: 0.5.0
|
4
|
+
Summary: Yomitoku is an AI-powered document image analysis package designed specifically for the Japanese language.
|
5
5
|
Author-email: Kotaro Kinoshita <kotaro.kinoshita@mlism.com>
|
6
6
|
License: CC BY-NC-SA 4.0
|
7
7
|
Keywords: Deep Learning,Japanese,OCR
|
@@ -10,24 +10,25 @@ Requires-Dist: huggingface-hub>=0.26.1
|
|
10
10
|
Requires-Dist: lxml>=5.3.0
|
11
11
|
Requires-Dist: omegaconf>=2.3.0
|
12
12
|
Requires-Dist: opencv-python>=4.10.0.84
|
13
|
-
Requires-Dist: pdf2image>=1.17.0
|
14
13
|
Requires-Dist: pyclipper>=1.3.0.post6
|
15
14
|
Requires-Dist: pydantic>=2.9.2
|
15
|
+
Requires-Dist: pypdfium2>=4.30.0
|
16
16
|
Requires-Dist: shapely>=2.0.6
|
17
17
|
Requires-Dist: timm>=1.0.11
|
18
|
-
Requires-Dist: torch
|
18
|
+
Requires-Dist: torch==2.5.0
|
19
19
|
Requires-Dist: torchvision>=0.20.0
|
20
20
|
Description-Content-Type: text/markdown
|
21
21
|
|
22
|
-
|
22
|
+
日本語版 | [English](README_EN.md)
|
23
|
+
|
24
|
+
<img src="static/logo/horizontal.png" width="800px">
|
23
25
|
|
24
26
|

|
25
27
|

|
26
|
-

|
29
|
+

|
27
30
|
[](https://kotaro-kinoshita.github.io/yomitoku-dev/)
|
28
31
|
|
29
|
-
<img src="static/logo/horizontal.png" width="800px">
|
30
|
-
|
31
32
|
## 🌟 概要
|
32
33
|
|
33
34
|
YomiToku は日本語に特化した AI 文章画像解析エンジン(Document AI)です。画像内の文字の全文 OCR およびレイアウト解析機能を有しており、画像内の文字情報や図表を認識、抽出、変換します。
|
@@ -60,31 +61,16 @@ Markdown でエクスポートした結果は関してはリポジトリ内の[s
|
|
60
61
|
|
61
62
|
## 📣 リリース情報
|
62
63
|
|
63
|
-
- 2024 年
|
64
|
+
- 2024 年 11 月 26 YomiToku v0.5.0 ベータ版を公開
|
64
65
|
|
65
66
|
## 💡 インストールの方法
|
66
67
|
|
67
68
|
```
|
68
|
-
pip install
|
69
|
+
pip install yomitoku
|
69
70
|
```
|
70
71
|
|
71
|
-
- pytorch
|
72
|
-
|
73
|
-
### 依存ライブラリ
|
74
|
-
|
75
|
-
pdf ファイルの解析を行うためには、別途、[poppler](https://poppler.freedesktop.org/)のインストールが必要です。
|
76
|
-
|
77
|
-
**Mac**
|
78
|
-
|
79
|
-
```
|
80
|
-
brew install poppler
|
81
|
-
```
|
82
|
-
|
83
|
-
**Linux**
|
84
|
-
|
85
|
-
```
|
86
|
-
apt install poppler-utils -y
|
87
|
-
```
|
72
|
+
- pytorch はご自身の CUDAのバージョンにあったものをインストールしてください。デフォルトではCUDA12.4以上に対応したものがインストールされます。
|
73
|
+
- pytorch は2.5以上のバージョンに対応しています。その関係でCUDA11.8以上のバージョンが必要になります。対応できない場合は、リポジトリ内のDockerfileを利用してください。
|
88
74
|
|
89
75
|
## 🚀 実行方法
|
90
76
|
|
@@ -98,8 +84,8 @@ yomitoku ${path_data} -f md -o results -v --figure
|
|
98
84
|
- `-v`, `--vis` を指定すると解析結果を可視化した画像を出力します。
|
99
85
|
- `-d`, `--device` モデルを実行するためのデバイスを指定します。gpu が利用できない場合は cpu で推論が実行されます。(デフォルト: cuda)
|
100
86
|
- `--ignore_line_break` 画像の改行位置を無視して、段落内の文章を連結して返します。(デフォルト:画像通りの改行位置位置で改行します。)
|
101
|
-
-
|
102
|
-
-
|
87
|
+
- `--figure_letter` 検出した図表に含まれる文字も出力ファイルにエクスポートします。
|
88
|
+
- `--figure` 検出した図、画像を出力ファイルにエクスポートします。(html と markdown のみ)
|
103
89
|
|
104
90
|
その他のオプションに関しては、ヘルプを参照
|
105
91
|
|
@@ -107,11 +93,10 @@ yomitoku ${path_data} -f md -o results -v --figure
|
|
107
93
|
yomitoku --help
|
108
94
|
```
|
109
95
|
|
110
|
-
|
111
|
-
|
112
|
-
- CPU を用いての推論向けに最適化されておらず、処理時間が長くなりますので、GPU での実行を推奨します。
|
96
|
+
**NOTE**
|
97
|
+
- GPU での実行を推奨します。CPU を用いての推論向けに最適化されておらず、処理時間が長くなります。
|
113
98
|
- 活字のみ識別をサポートしております。手書き文字に関しては、読み取れる場合もありますが、公式にはサポートしておりません。
|
114
|
-
-
|
99
|
+
- Yomitoku は文書 OCR 向けに最適化されており、情景 OCR(看板など紙以外にプリントされた文字の読み取り)向けには最適化されていません。
|
115
100
|
- AI-OCR の識別精度を高めるために、入力画像の解像度が重要です。低解像度画像では識別精度が低下します。最低でも画像の短辺を 720px 以上の画像で推論することをお勧めします。
|
116
101
|
|
117
102
|
## 📝 ドキュメント
|
@@ -120,8 +105,8 @@ yomitoku --help
|
|
120
105
|
|
121
106
|
## LICENSE
|
122
107
|
|
123
|
-
|
124
|
-
|
108
|
+
本リポジトリ内に格納されているソースコードおよび本プロジェクトに関連する HuggingFaceHub 上のモデルの重みファイルのライセンスは CC BY-NC-SA 4.0 に従います。
|
109
|
+
非商用での個人利用、研究目的での利用はご自由にお使いください。
|
125
110
|
商用目的での利用に関しては、別途、商用ライセンスを提供しますので、開発者にお問い合わせください。
|
126
111
|
|
127
|
-
YomiToku © 2024 by
|
112
|
+
YomiToku © 2024 by Kotaro Kinoshita is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
|
@@ -1,12 +1,13 @@
|
|
1
|
-
|
1
|
+
日本語版 | [English](README_EN.md)
|
2
|
+
|
3
|
+
<img src="static/logo/horizontal.png" width="800px">
|
2
4
|
|
3
5
|

|
4
6
|

|
5
|
-

|
8
|
+

|
6
9
|
[](https://kotaro-kinoshita.github.io/yomitoku-dev/)
|
7
10
|
|
8
|
-
<img src="static/logo/horizontal.png" width="800px">
|
9
|
-
|
10
11
|
## 🌟 概要
|
11
12
|
|
12
13
|
YomiToku は日本語に特化した AI 文章画像解析エンジン(Document AI)です。画像内の文字の全文 OCR およびレイアウト解析機能を有しており、画像内の文字情報や図表を認識、抽出、変換します。
|
@@ -39,31 +40,16 @@ Markdown でエクスポートした結果は関してはリポジトリ内の[s
|
|
39
40
|
|
40
41
|
## 📣 リリース情報
|
41
42
|
|
42
|
-
- 2024 年
|
43
|
+
- 2024 年 11 月 26 YomiToku v0.5.0 ベータ版を公開
|
43
44
|
|
44
45
|
## 💡 インストールの方法
|
45
46
|
|
46
47
|
```
|
47
|
-
pip install
|
48
|
+
pip install yomitoku
|
48
49
|
```
|
49
50
|
|
50
|
-
- pytorch
|
51
|
-
|
52
|
-
### 依存ライブラリ
|
53
|
-
|
54
|
-
pdf ファイルの解析を行うためには、別途、[poppler](https://poppler.freedesktop.org/)のインストールが必要です。
|
55
|
-
|
56
|
-
**Mac**
|
57
|
-
|
58
|
-
```
|
59
|
-
brew install poppler
|
60
|
-
```
|
61
|
-
|
62
|
-
**Linux**
|
63
|
-
|
64
|
-
```
|
65
|
-
apt install poppler-utils -y
|
66
|
-
```
|
51
|
+
- pytorch はご自身の CUDAのバージョンにあったものをインストールしてください。デフォルトではCUDA12.4以上に対応したものがインストールされます。
|
52
|
+
- pytorch は2.5以上のバージョンに対応しています。その関係でCUDA11.8以上のバージョンが必要になります。対応できない場合は、リポジトリ内のDockerfileを利用してください。
|
67
53
|
|
68
54
|
## 🚀 実行方法
|
69
55
|
|
@@ -77,8 +63,8 @@ yomitoku ${path_data} -f md -o results -v --figure
|
|
77
63
|
- `-v`, `--vis` を指定すると解析結果を可視化した画像を出力します。
|
78
64
|
- `-d`, `--device` モデルを実行するためのデバイスを指定します。gpu が利用できない場合は cpu で推論が実行されます。(デフォルト: cuda)
|
79
65
|
- `--ignore_line_break` 画像の改行位置を無視して、段落内の文章を連結して返します。(デフォルト:画像通りの改行位置位置で改行します。)
|
80
|
-
-
|
81
|
-
-
|
66
|
+
- `--figure_letter` 検出した図表に含まれる文字も出力ファイルにエクスポートします。
|
67
|
+
- `--figure` 検出した図、画像を出力ファイルにエクスポートします。(html と markdown のみ)
|
82
68
|
|
83
69
|
その他のオプションに関しては、ヘルプを参照
|
84
70
|
|
@@ -86,11 +72,10 @@ yomitoku ${path_data} -f md -o results -v --figure
|
|
86
72
|
yomitoku --help
|
87
73
|
```
|
88
74
|
|
89
|
-
|
90
|
-
|
91
|
-
- CPU を用いての推論向けに最適化されておらず、処理時間が長くなりますので、GPU での実行を推奨します。
|
75
|
+
**NOTE**
|
76
|
+
- GPU での実行を推奨します。CPU を用いての推論向けに最適化されておらず、処理時間が長くなります。
|
92
77
|
- 活字のみ識別をサポートしております。手書き文字に関しては、読み取れる場合もありますが、公式にはサポートしておりません。
|
93
|
-
-
|
78
|
+
- Yomitoku は文書 OCR 向けに最適化されており、情景 OCR(看板など紙以外にプリントされた文字の読み取り)向けには最適化されていません。
|
94
79
|
- AI-OCR の識別精度を高めるために、入力画像の解像度が重要です。低解像度画像では識別精度が低下します。最低でも画像の短辺を 720px 以上の画像で推論することをお勧めします。
|
95
80
|
|
96
81
|
## 📝 ドキュメント
|
@@ -99,8 +84,8 @@ yomitoku --help
|
|
99
84
|
|
100
85
|
## LICENSE
|
101
86
|
|
102
|
-
|
103
|
-
|
87
|
+
本リポジトリ内に格納されているソースコードおよび本プロジェクトに関連する HuggingFaceHub 上のモデルの重みファイルのライセンスは CC BY-NC-SA 4.0 に従います。
|
88
|
+
非商用での個人利用、研究目的での利用はご自由にお使いください。
|
104
89
|
商用目的での利用に関しては、別途、商用ライセンスを提供しますので、開発者にお問い合わせください。
|
105
90
|
|
106
|
-
YomiToku © 2024 by
|
91
|
+
YomiToku © 2024 by Kotaro Kinoshita is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
|
@@ -0,0 +1,93 @@
|
|
1
|
+
[日本語版](README.md) | English
|
2
|
+
|
3
|
+
<img src="static/logo/horizontal.png" width="800px">
|
4
|
+
|
5
|
+

|
6
|
+

|
7
|
+

|
8
|
+

|
9
|
+
[](https://kotaro-kinoshita.github.io/yomitoku-dev/)
|
10
|
+
|
11
|
+
## 🌟 Introduction
|
12
|
+
|
13
|
+
YomiToku is a Document AI engine specialized in Japanese document image analysis. It provides full OCR (optical character recognition) and layout analysis capabilities, enabling the recognition, extraction, and conversion of text and diagrams from images.
|
14
|
+
|
15
|
+
- 🤖 Equipped with four AI models trained on Japanese datasets: text detection, text recognition, layout analysis, and table structure recognition. All models are independently trained and optimized for Japanese documents, delivering high-precision inference.
|
16
|
+
- 🇯🇵 Each model is specifically trained for Japanese document images, supporting the recognition of over 7,000 Japanese characters, including vertical text and other layout structures unique to Japanese documents. (It also supports English documents.)
|
17
|
+
- 📈 By leveraging layout analysis, table structure parsing, and reading order estimation, it extracts information while preserving the semantic structure of the document layout.
|
18
|
+
- 📄 Supports a variety of output formats, including HTML, Markdown, JSON, and CSV. It also allows for the extraction of diagrams and images contained within the documents.
|
19
|
+
- ⚡ Operates efficiently in GPU environments, enabling fast document transcription and analysis. It requires less than 8GB of VRAM, eliminating the need for high-end GPUs.
|
20
|
+
|
21
|
+
## 🖼️ Demo
|
22
|
+
|
23
|
+
The verification results for various types of images are also included in [gallery.md](gallery.md)
|
24
|
+
|
25
|
+
| Input | Results of OCR |
|
26
|
+
| :--------------------------------------------------------: | :-----------------------------------------------------: |
|
27
|
+
| <img src="static/in/demo.jpg" width="400px"> | <img src="static/out/in_demo_p1_ocr.jpg" width="400px"> |
|
28
|
+
| Results of Layout Analysis | Results of HTML Export |
|
29
|
+
| <img src="static/out/in_demo_p1_layout.jpg" width="400px"> | <img src="static/out/demo_html.png" width="400px"> |
|
30
|
+
|
31
|
+
|
32
|
+
For the results exported in Markdown, please refer to [static/out/in_demo_p1.md](static/out/in_demo_p1.md) in the repository.
|
33
|
+
|
34
|
+
- `Red Frame`: Positions of figures and images
|
35
|
+
- `Green Frame`: Overall table region
|
36
|
+
- `Pink Frame`:` Table cell structure (text within the cells represents [row number, column number] (rowspan x colspan))
|
37
|
+
- `Blue Frame`: Paragraph and text group regions
|
38
|
+
- `Red Arrow`: Results of reading order estimation
|
39
|
+
|
40
|
+
Source of the image: Created by processing content from “Reiwa 6 Edition Information and Communications White Paper, Chapter 3, Section 2: Technologies Advancing with AI Evolution” (https://www.soumu.go.jp/johotsusintokei/whitepaper/ja/r06/pdf/n1410000.pdf):(Ministry of Internal Affairs and Communications).
|
41
|
+
|
42
|
+
## 📣 Release
|
43
|
+
|
44
|
+
- Released YomiToku vX.X.X on December XX, 2024.
|
45
|
+
|
46
|
+
## 💡 Installation
|
47
|
+
|
48
|
+
```
|
49
|
+
pip install yomitoku
|
50
|
+
```
|
51
|
+
|
52
|
+
|
53
|
+
- Please install the version of PyTorch that matches your CUDA version. By default, a version compatible with CUDA 12.4 or higher will be installed.
|
54
|
+
- PyTorch versions 2.5 and above are supported. As a result, CUDA version 11.8 or higher is required. If this is not feasible, please use the Dockerfile provided in the repository.
|
55
|
+
|
56
|
+
## 🚀 Usage
|
57
|
+
|
58
|
+
```
|
59
|
+
yomitoku ${path_data} -f md -o results -v --figure
|
60
|
+
```
|
61
|
+
|
62
|
+
- `${path_data}`: Specify the path to a directory containing images to be analyzed or directly provide the path to an image file. If a directory is specified, images in its subdirectories will also be processed.
|
63
|
+
- `-f`, `--format`: Specify the output file format. Supported formats are json, csv, html, and md.
|
64
|
+
- `-o`, `--outdir`: Specify the name of the output directory. If it does not exist, it will be created.
|
65
|
+
- `-v`, `--vis`: If specified, outputs visualized images of the analysis results.
|
66
|
+
- `-d`, `--device`: Specify the device for running the model. If a GPU is unavailable, inference will be executed on the CPU. (Default: cuda)
|
67
|
+
- `--ignore_line_break`: Ignores line breaks in the image and concatenates sentences within a paragraph. (Default: respects line breaks as they appear in the image.)
|
68
|
+
- `--figure_letter`: Exports characters contained within detected figures and tables to the output file.
|
69
|
+
- `--figure`: Exports detected figures and images to the output file (supported only for html and markdown).
|
70
|
+
|
71
|
+
|
72
|
+
For other options, please refer to the help documentation.
|
73
|
+
```
|
74
|
+
yomitoku --help
|
75
|
+
```
|
76
|
+
|
77
|
+
**NOTE**
|
78
|
+
- It is recommended to run on a GPU. The system is not optimized for inference on CPUs, which may result in significantly longer processing times.
|
79
|
+
- Only printed text recognition is supported. While it may occasionally read handwritten text, official support is not provided.
|
80
|
+
- YomiToku is optimized for document OCR and is not designed for scene OCR (e.g., text printed on non-paper surfaces like signs).
|
81
|
+
- The resolution of input images is critical for improving the accuracy of AI-OCR recognition. Low-resolution images may lead to reduced recognition accuracy. It is recommended to use images with a minimum short side resolution of 720px for inference.
|
82
|
+
|
83
|
+
## 📝 Documents
|
84
|
+
|
85
|
+
For more details, please refer to the [documentation](https://kotaro-kinoshita.github.io/yomitoku-dev/)
|
86
|
+
|
87
|
+
## LICENSE
|
88
|
+
|
89
|
+
The source code stored in this repository and the model weight files related to this project on Hugging Face Hub are licensed under CC BY-NC-SA 4.0.
|
90
|
+
You are free to use them for non-commercial personal use or research purposes.
|
91
|
+
For commercial use, a separate commercial license is available. Please contact the developers for more information.
|
92
|
+
|
93
|
+
YomiToku © 2024 by Kotaro Kinoshita is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/4.0/
|
@@ -6,9 +6,7 @@ from yomitoku.data.functions import load_pdf
|
|
6
6
|
if __name__ == "__main__":
|
7
7
|
PATH_IMGE = ""
|
8
8
|
|
9
|
-
configs = {
|
10
|
-
"ocr": {"text_detector": {"path_cfg": "demo/text_detector.yaml"}}
|
11
|
-
}
|
9
|
+
configs = {"ocr": {"text_detector": {"path_cfg": "demo/text_detector.yaml"}}}
|
12
10
|
|
13
11
|
analyzer = DocumentAnalyzer(configs=configs, visualize=True, device="cuda")
|
14
12
|
|
@@ -32,6 +32,6 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON
|
|
32
32
|
|
33
33
|
RUN python -m pip install --upgrade pip
|
34
34
|
|
35
|
-
RUN pip install
|
35
|
+
RUN pip install yomitoku
|
36
36
|
|
37
37
|
WORKDIR /workspace
|
@@ -0,0 +1,21 @@
|
|
1
|
+
## 🌟 Introduction
|
2
|
+
|
3
|
+
YomiToku is a Document AI engine specialized in Japanese document image analysis. It provides full OCR (optical character recognition) and layout analysis capabilities, enabling the recognition, extraction, and conversion of text and diagrams from images.
|
4
|
+
|
5
|
+
- 🤖 Equipped with four AI models trained on Japanese datasets: text detection, text recognition, layout analysis, and table structure recognition. All models are independently trained and optimized for Japanese documents, delivering high-precision inference.
|
6
|
+
- 🇯🇵 Each model is specifically trained for Japanese document images, supporting the recognition of over 7,000 Japanese characters, including vertical text and other layout structures unique to Japanese documents. (It also supports English documents.)
|
7
|
+
- 📈 By leveraging layout analysis, table structure parsing, and reading order estimation, it extracts information while preserving the semantic structure of the document layout.
|
8
|
+
- 📄 Supports a variety of output formats, including HTML, Markdown, JSON, and CSV. It also allows for the extraction of diagrams and images contained within the documents.
|
9
|
+
- ⚡ Operates efficiently in GPU environments, enabling fast document transcription and analysis. It requires less than 8GB of VRAM, eliminating the need for high-end GPUs.。
|
10
|
+
|
11
|
+
## 🙋 FAQ
|
12
|
+
|
13
|
+
### Q. Is it possible to use YomiToku in an environment without internet access?
|
14
|
+
A. Yes, it is possible.
|
15
|
+
YomiToku connects to Hugging Face Hub to automatically download model files during the first execution, requiring internet access at that time. However, you can manually download the files in advance, allowing YomiToku to operate in an offline environment. For details, please refer to Usage under the section "Using YomiToku in an Offline Environment."
|
16
|
+
|
17
|
+
### Q. Is commercial use allowed?
|
18
|
+
A. This package is licensed under CC BY-NC 4.0. It is available for free for personal and research purposes. For commercial use, a paid commercial license is required. Please contact the developers for further details.
|
19
|
+
|
20
|
+
### Q. Can handwritten text be recognized?
|
21
|
+
A. Only printed text recognition is supported. While handwritten text may occasionally be recognized, it is not officially supported.
|
@@ -8,20 +8,6 @@ YomiToku は日本語に特化した AI 文章画像解析エンジン(Document
|
|
8
8
|
- 📄 多様な出力形式をサポートしています。html やマークダウン、json、csv のいずれかのフォーマットに変換可能です。また、文書内に含まれる図表、画像の抽出の出力も可能です。
|
9
9
|
- ⚡ GPU環境で高速に動作し、効率的に文書の文字起こし解析が可能です。また、VRAMも8GB以内で動作し、ハイエンドなGPUを用意する必要はありません。
|
10
10
|
|
11
|
-
## 🚀 主な機能
|
12
|
-
|
13
|
-
- 日本語の文書画像向けの汎用 AI-OCR 機能
|
14
|
-
- 文書画像のレイアウト解析 AI による図表や段落の自動推定機能
|
15
|
-
- 表の構造解析 AI による表の行列構造の認識機能
|
16
|
-
|
17
|
-
## 🔥 今後の開発予定
|
18
|
-
|
19
|
-
YomiToku は現在も開発中であり、今後以下のような機能の拡張を目指しています。
|
20
|
-
|
21
|
-
- 手書き文字の認識
|
22
|
-
- 数式の検知や認識、Latex フォーマットへの変換
|
23
|
-
- レイアウト解析機能の拡張による識別要素の細分化(タイトル、見出し、図表のキャプション)
|
24
|
-
|
25
11
|
## 🙋 FAQ
|
26
12
|
|
27
13
|
### Q. インターネットに接続できない環境での動作は可能ですか?
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Installation
|
2
|
+
|
3
|
+
|
4
|
+
This package requires Python 3.9 or later and PyTorch 2.5 or later for execution. PyTorch must be installed according to your CUDA version. A GPU with more than 8GB of VRAM is recommended. While it can run on a CPU, please note that the processing is not currently optimized for CPUs, which may result in longer execution times.
|
5
|
+
|
6
|
+
## from PYPI
|
7
|
+
|
8
|
+
```bash
|
9
|
+
pip install yomitoku
|
10
|
+
```
|
11
|
+
|
12
|
+
## using uv
|
13
|
+
This repository uses the package management tool [uv](https://docs.astral.sh/uv/). After installing uv, clone the repository and execute the following commands:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
uv sync
|
17
|
+
```
|
18
|
+
|
19
|
+
When using uv, you need to modify the following part of the pyproject.toml file to match your CUDA version. By default, PyTorch compatible with CUDA 12.4 will be downloaded.
|
20
|
+
|
21
|
+
```pyproject.tom
|
22
|
+
[[tool.uv.index]]
|
23
|
+
name = "pytorch-cuda124"
|
24
|
+
url = "https://download.pytorch.org/whl/cu124"
|
25
|
+
explicit = true
|
26
|
+
```
|
27
|
+
|
28
|
+
|
29
|
+
## using docker
|
30
|
+
|
31
|
+
A Dockerfile is provided in the root of the repository, which you are welcome to use.
|
32
|
+
|
33
|
+
```bash
|
34
|
+
docker build -t yomitoku .
|
35
|
+
```
|
36
|
+
|
37
|
+
=== "GPU"
|
38
|
+
|
39
|
+
```bash
|
40
|
+
docker run -it --gpus all -v $(pwd):/workspace --name yomitoku yomitoku /bin/bash
|
41
|
+
```
|
42
|
+
|
43
|
+
=== "CPU"
|
44
|
+
|
45
|
+
```bash
|
46
|
+
docker run -it -v $(pwd):/workspace --name yomitoku yomitoku /bin/bash
|
47
|
+
```
|
@@ -2,38 +2,29 @@
|
|
2
2
|
|
3
3
|
本パッケージは Python3.9+, Pytorch が実行に必要です。Pytorch はご自身の環境に合わせて、インストールが必要です。計算機は GPU(> VRAM 8G)を推奨しています。CPU でも動作しますが、現在、CPU 向けに処理が最適化されておらず、実行に時間がかかりますのでご注意ください。
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
## 依存パッケージのインストール
|
8
|
-
|
9
|
-
pdf ファイルの解析を行うためには、別途、[poppler](https://poppler.freedesktop.org/)のインストールが必要です。
|
10
|
-
|
11
|
-
=== "Mac"
|
12
|
-
|
13
|
-
```
|
14
|
-
brew install poppler
|
15
|
-
```
|
16
|
-
|
17
|
-
=== "Linux"
|
18
|
-
|
19
|
-
```
|
20
|
-
apt install poppler-utils -y
|
21
|
-
```
|
22
|
-
|
23
|
-
## PIP でインストール
|
5
|
+
## PYPI からインストール
|
24
6
|
|
25
7
|
```bash
|
26
|
-
pip install
|
8
|
+
pip install yomitoku
|
27
9
|
```
|
28
10
|
|
29
|
-
##
|
11
|
+
## uv でのインストール
|
30
12
|
|
31
|
-
本リポジトリはパッケージ管理ツールに [
|
13
|
+
本リポジトリはパッケージ管理ツールに [uv](https://docs.astral.sh/uv/) を使用しています。uv をインストール後、リポジトリをクローンし、以下のコマンドを実行してください
|
32
14
|
|
33
15
|
```bash
|
34
16
|
uv sync
|
35
17
|
```
|
36
18
|
|
19
|
+
uvを利用する場合、`pyproject.toml`の以下の部分をご自身のcudaのバージョンに合わせて修正する必要があります。デフォルトではCUDA12.4に対応したpytorchがダウンロードされます。
|
20
|
+
|
21
|
+
```pyproject.tom
|
22
|
+
[[tool.uv.index]]
|
23
|
+
name = "pytorch-cuda124"
|
24
|
+
url = "https://download.pytorch.org/whl/cu124"
|
25
|
+
explicit = true
|
26
|
+
```
|
27
|
+
|
37
28
|
## Docker 環境での実行
|
38
29
|
|
39
30
|
リポジトリの直下に dockerfile を配置していますので、そちらも活用いただけます。
|
@@ -45,11 +36,11 @@ docker build -t yomitoku .
|
|
45
36
|
=== "GPU"
|
46
37
|
|
47
38
|
```bash
|
48
|
-
docker run -it --gpus all -v $(pwd):/workspace --name yomitoku yomitoku /bin/
|
39
|
+
docker run -it --gpus all -v $(pwd):/workspace --name yomitoku yomitoku /bin/bash
|
49
40
|
```
|
50
41
|
|
51
42
|
=== "CPU"
|
52
43
|
|
53
44
|
```bash
|
54
|
-
docker run -it -v $(pwd):/workspace --name yomitoku yomitoku /bin/
|
45
|
+
docker run -it -v $(pwd):/workspace --name yomitoku yomitoku /bin/bash
|
55
46
|
```
|