Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
f9ed2aa
Initial project setup with dependencies and license
Mar 28, 2025
8001947
Add project README with documentation and usage instructions
Mar 28, 2025
d97da0c
Add core utility functions for integrations
Mar 28, 2025
74a12b0
Add data schemas for the OCR pipeline
Mar 28, 2025
db67c1e
Add OCR comparison pipeline framework
Mar 28, 2025
377263b
Add model evaluation step for OCR comparison
Mar 28, 2025
f09655d
Add main execution script for OCR pipeline
Mar 28, 2025
0de7871
Add image encoding, metrics calculation and prompt utilities
Mar 28, 2025
25347d3
Add OCR implementation steps for Gemma3 and Mistral models
Mar 28, 2025
2387351
Add Streamlit web interface for interactive OCR comparison
Mar 28, 2025
71b8b94
Add sample images for OCR testing
Mar 28, 2025
e885c25
update README
Mar 28, 2025
c6b5ce6
Add configuration settings for OCR pipeline
Mar 28, 2025
2b45149
Add standalone script for quick OCR comparison without ZenML
Mar 28, 2025
3ea4f93
Add poetry.lock file to lock dependencies
Mar 28, 2025
66d0de1
Add pip requirements file for non-Poetry installations
Mar 28, 2025
a747636
Add ImageDescription pydantic model for the OCR pipeline
Mar 28, 2025
1c4ee21
update readme
Mar 28, 2025
c70c6e9
update assets dir structure
Mar 28, 2025
b60e1a6
update prompt.py: add confidence for extracted text
Mar 29, 2025
08a8fc6
add confidence field to ImageDescription
Mar 29, 2025
b14b16a
organize assets dir
Mar 29, 2025
4882760
remove integrations utils: remove mlflow, and docker for now
Mar 29, 2025
991298b
add pipelines __init__ file
Mar 29, 2025
235993a
add other init files
Mar 29, 2025
e34e924
add run_ocr.py file: reusable ocr step for various models
Mar 29, 2025
9210dd2
delete run_gemma3_ocr and run_mistral_ocr in favor of unified run_ocr…
Mar 29, 2025
4892b3f
update ocr_pipeline to save ocr results and visualizations
Mar 29, 2025
168e3c5
update save ocr results step
Mar 29, 2025
43da0dc
add configs dir with ocr_config yaml file
Mar 29, 2025
ffa8601
add config util file
Mar 29, 2025
b7d0b93
add io utils file for loading images/files and for saving results
Mar 29, 2025
21711ca
add ocr model utils file for processing chat completions for various …
Mar 29, 2025
6a3fd96
add step for loading images/files
Mar 29, 2025
19193a4
add run.py file
Mar 29, 2025
5b9afed
pass each result dict to save_ocr_results step to resolve StepInterfa…
Mar 29, 2025
82f2dd7
update ocr_pipeline to pass model_names in addition to results when s…
Mar 29, 2025
d191735
refactor error_analysis and metrics under 1 file and remove confidenc…
Mar 29, 2025
4928919
add detailed html string containing ocr results, error analysis and o…
Mar 29, 2025
b4c5987
update config file with default image folder
Mar 29, 2025
34cb61a
update app.py
Mar 29, 2025
625156a
Add detailed metrics to streamlit UI app
Mar 29, 2025
efcdd1d
Update README.md: fix broken links, and add project organization
Mar 29, 2025
023ca45
remove pyproject.toml and poetry.lock in favor of single requirements…
Mar 29, 2025
b3f1137
update requirements.txt
Mar 29, 2025
5f01ba3
remove mlflow from readme
Mar 29, 2025
7efe6d7
delete unused assets
Mar 30, 2025
682ebd8
update prompt to clarify entitiy output
Mar 30, 2025
3f739b9
refactor app.py: simplify and remove entities/description
Mar 31, 2025
4c00594
update assets
Mar 31, 2025
70bbacf
add model_info util forgetting model metadata throughout the app
Mar 31, 2025
3e894e8
update save results to dynamically render model info
Mar 31, 2025
c5ff0ff
move ImageDescription schema into prompt
Mar 31, 2025
cb22d7d
update steps to integrate changes
Mar 31, 2025
70c6f45
update ocr pipeline
Mar 31, 2025
a33b38c
update run and run_compare_ocr entrypoint files
Mar 31, 2025
8f44467
refactor main.py -- remove ground-trith-texts flag
Mar 31, 2025
ee4bc8d
update README.md
Mar 31, 2025
1063522
update ocr_config.yaml: remove image_patterns, update keys
Mar 31, 2025
d8c6ded
update assets
Mar 31, 2025
3be4143
delete config.yaml
Mar 31, 2025
5e0897a
update ocr model utils to process images with ollama api rather than …
Mar 31, 2025
9e06ff7
remove running_from_ui param
Mar 31, 2025
27e610c
add run_ollama_ocr_from_ui function for streamlit app
Mar 31, 2025
bbfd4e6
add docker settings for ocr pipeline
Mar 31, 2025
d1eb77e
update run_compare_ocr
Mar 31, 2025
17e1a4c
refactor run_ocr
Mar 31, 2025
0de8ddc
add Dockerfile and .dockerignore
Mar 31, 2025
16f3b77
update requirements.txt
Mar 31, 2025
b65894b
refactor: revert to use litellm+instructor for ollama models
Mar 31, 2025
9b4e584
edit api_key access for OpenAI client
Mar 31, 2025
87c05df
add logos for different ocr models
Apr 1, 2025
73c3aba
update utils for multi-model ocr
Apr 1, 2025
58ac407
update steps for multi-model ocr changes
Apr 1, 2025
6a0295f
add model_configs util for centralized model configuration and client…
Apr 1, 2025
4d96ae3
rename ocr_model_utils to ocr_processing
Apr 1, 2025
991e89f
update pipeline for multi-model ocr and update docker settings
Apr 1, 2025
0c05d71
update entrypoint run files
Apr 1, 2025
9ad7c8a
refactor streamlit app for readability and allow any number of models…
Apr 1, 2025
e316cfc
update README
Apr 1, 2025
ff58276
update ocr_config.yaml to integrate new changes
Apr 1, 2025
0e3638c
update assets
Apr 1, 2025
9095d01
update assets
Apr 1, 2025
7ec8df3
improve UI for comparing and displaying multiple models
Apr 1, 2025
28d698a
add extract json util
Apr 1, 2025
70a9c5e
add .env.example
Apr 1, 2025
e5f5924
update pipeline
Apr 1, 2025
7e7e108
update ocr processing, metrics, and model configs
Apr 1, 2025
233f95c
update utils and revamp evaluate_models
Apr 1, 2025
903923b
pass MODEL_CONFIGS in streamlit ocr processing
Apr 1, 2025
a3be487
set defaults for ground_truth_model for project
Apr 1, 2025
515aa0c
add images for README
Apr 1, 2025
e877918
update requirements.txt
Apr 1, 2025
f328c41
remove demo_models from utils
Apr 1, 2025
46bfb7f
update README: add images, links, docs
Apr 1, 2025
f1ec1b5
simplify assets dir
Apr 3, 2025
575a0d6
delete unused assets
Apr 3, 2025
6ecc9b5
update steps
Apr 3, 2025
d6cc858
add loaders.py
Apr 3, 2025
92e3fa0
update utils
Apr 3, 2025
8e70923
separate batch ocr from evaluation into 2 pipelines
Apr 3, 2025
7c2e498
add ground_truth_texts samples matching images provided
Apr 3, 2025
5b82b7e
remove run_compare_ocr and main.py in favor of run.py
Apr 3, 2025
987477d
update config.yaml to align with zenml config file definition
Apr 3, 2025
82a4bcc
update README
Apr 3, 2025
f501c4a
update .env.example
Apr 3, 2025
8447714
re-integrate docker settings and cleanup config.yaml
Apr 4, 2025
7062613
update image links in README
Apr 4, 2025
c31edfa
update visualization img
Apr 4, 2025
868e3b7
update assets
Apr 4, 2025
7496685
refactor utils
Apr 7, 2025
a792081
move visualization logic into util file
Apr 7, 2025
32a1bbc
refactor steps: remove local saving/loading and integrate artifacts
Apr 7, 2025
637655a
refactor pipelines: remove save/load from local dirs + split config f…
Apr 7, 2025
a7e4fa8
split config into dedicated config files for each pipeline
Apr 7, 2025
fc45c9d
add schemas dir
Apr 7, 2025
394e8ce
update requirements.txt
Apr 7, 2025
aa0190f
update run.py: simplify args, and integrate new config structure
Apr 7, 2025
5dcf313
delete main.py
Apr 7, 2025
94d8e62
update configs
Apr 7, 2025
09e847f
add docker settings in pipeline definitions
Apr 7, 2025
51c8eae
update README
Apr 7, 2025
df81509
add analyse and Labour to .typos.toml
Apr 7, 2025
bbbd82c
cleanup pipelines and add small html visualization for batch pipeline
Apr 8, 2025
bcaf3df
cleanup utils
Apr 8, 2025
2d4b4bf
update steps/evaluate models to use combined dataframe from updated r…
Apr 8, 2025
09c5704
update loader to work with Dataframe directly, and not a dict
Apr 8, 2025
cb91618
coerce potential lists being returned in model responses to strings
Apr 8, 2025
b443344
update README
Apr 8, 2025
894366f
cleanup configs and run_ocr
Apr 8, 2025
d8a654d
cleanup requirements.txt
Apr 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ huggingface = "huggingface"
answerdotai = "answerdotai"
preprocessor = "preprocessor"
logits = "logits"
analyse = "analyse"
Labour = "Labour"

[default]
locale = "en-us"
locale = "en-us"
5 changes: 5 additions & 0 deletions omni-reader/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.venv*
.requirements*
__pycache__/
*.py[cod]
*$py.class
3 changes: 3 additions & 0 deletions omni-reader/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENAI_API_KEY=your_openai_api_key
MISTRAL_API_KEY=your_mistral_api_key
OLLAMA_HOST=base_url_for_ollama_host # defaults to "http://localhost:11434/api/generate" if not set
104 changes: 104 additions & 0 deletions omni-reader/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# Virtual Environment
venv/
env/
.env
.venv/
ENV/

# IDE
.idea/
.vscode/
*.swp
*.swo
.project
.pydevproject
.settings/
*.sublime-workspace
*.sublime-project

# Jupyter Notebook
.ipynb_checkpoints
*.ipynb

# Model checkpoints and evaluation results
eval_results/
runs/
wandb/
*.pt
*.pth
*.ckpt
*.bin
model_outputs/

# Data
*.csv
*.tsv
!requirements.txt

# Logs
*.log
logs/
tensorboard_logs/
lightning_logs/

# OS
.DS_Store
Thumbs.db
*.db
*.sqlite
*.sqlite3

# Environment variables
.env
.env.local
.env.*.local

# Testing
.coverage
htmlcov/
.pytest_cache/
.tox/
coverage.xml
*.cover
.hypothesis/

# Documentation
docs/_build/
site/

# Misc
*.bak
*.tmp
*.temp
.cache
.zen/

# Extras
checkpoints/
ruff.toml
models/
cache/
zenml_docs/
CLAUDE.md
201 changes: 201 additions & 0 deletions omni-reader/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 ZenML GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Loading
Loading