Skip to content

Commit 4a52922

Browse files
authored
feat: better image support (#71)
Updated the OCR logic to be aware of image elements.
1 parent 533fd47 commit 4a52922

File tree

17 files changed

+436
-211
lines changed

17 files changed

+436
-211
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.13-dev0
2+
3+
* Change OCR logic to be aware of PDF image elements
4+
15
## 0.2.12
26

37
* Fix for processing RGBA images

requirements/base.txt

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ certifi==2022.12.7
1212
# via requests
1313
cffi==1.15.1
1414
# via cryptography
15-
charset-normalizer==3.0.1
15+
charset-normalizer==3.1.0
1616
# via
1717
# pdfminer-six
1818
# requests
@@ -22,25 +22,26 @@ coloredlogs==15.0.1
2222
# via onnxruntime
2323
contourpy==1.0.7
2424
# via matplotlib
25-
cryptography==39.0.1
25+
cryptography==39.0.2
2626
# via pdfminer-six
2727
cycler==0.11.0
2828
# via matplotlib
2929
effdet==0.3.0
3030
# via layoutparser
31-
fastapi==0.92.0
31+
fastapi==0.95.0
3232
# via unstructured-inference (setup.py)
33-
filelock==3.9.0
33+
filelock==3.10.0
3434
# via
3535
# huggingface-hub
36+
# torch
3637
# transformers
37-
flatbuffers==23.1.21
38+
flatbuffers==23.3.3
3839
# via onnxruntime
39-
fonttools==4.38.0
40+
fonttools==4.39.2
4041
# via matplotlib
4142
h11==0.14.0
4243
# via uvicorn
43-
huggingface-hub==0.12.1
44+
huggingface-hub==0.13.3
4445
# via
4546
# timm
4647
# transformers
@@ -55,14 +56,20 @@ importlib-resources==5.12.0
5556
# via matplotlib
5657
iopath==0.1.10
5758
# via layoutparser
59+
jinja2==3.1.2
60+
# via torch
5861
kiwisolver==1.4.4
5962
# via matplotlib
6063
layoutparser[layoutmodels,tesseract]==0.3.4
6164
# via unstructured-inference (setup.py)
62-
matplotlib==3.7.0
65+
markupsafe==2.1.2
66+
# via jinja2
67+
matplotlib==3.7.1
6368
# via pycocotools
64-
mpmath==1.2.1
69+
mpmath==1.3.0
6570
# via sympy
71+
networkx==3.0
72+
# via torch
6673
numpy==1.24.2
6774
# via
6875
# contourpy
@@ -92,7 +99,7 @@ packaging==23.0
9299
# transformers
93100
pandas==1.5.3
94101
# via layoutparser
95-
pdf2image==1.16.2
102+
pdf2image==1.16.3
96103
# via layoutparser
97104
pdfminer-six==20221105
98105
# via pdfplumber
@@ -108,13 +115,13 @@ pillow==9.4.0
108115
# torchvision
109116
portalocker==2.7.0
110117
# via iopath
111-
protobuf==4.22.0
118+
protobuf==4.22.1
112119
# via onnxruntime
113120
pycocotools==2.0.6
114121
# via effdet
115122
pycparser==2.21
116123
# via cffi
117-
pydantic==1.10.5
124+
pydantic==1.10.6
118125
# via fastapi
119126
pyparsing==3.0.9
120127
# via matplotlib
@@ -142,39 +149,39 @@ requests==2.28.2
142149
# huggingface-hub
143150
# torchvision
144151
# transformers
145-
scipy==1.10.0
152+
scipy==1.10.1
146153
# via layoutparser
147154
six==1.16.0
148-
# via
149-
# python-dateutil
150-
# python-multipart
155+
# via python-dateutil
151156
sniffio==1.3.0
152157
# via anyio
153-
starlette==0.25.0
158+
starlette==0.26.1
154159
# via fastapi
155160
sympy==1.11.1
156-
# via onnxruntime
161+
# via
162+
# onnxruntime
163+
# torch
157164
timm==0.6.12
158165
# via effdet
159166
tokenizers==0.13.2
160167
# via transformers
161-
torch==1.13.1
168+
torch==2.0.0
162169
# via
163170
# effdet
164171
# layoutparser
165172
# timm
166173
# torchvision
167-
torchvision==0.14.1
174+
torchvision==0.15.1
168175
# via
169176
# effdet
170177
# layoutparser
171178
# timm
172-
tqdm==4.64.1
179+
tqdm==4.65.0
173180
# via
174181
# huggingface-hub
175182
# iopath
176183
# transformers
177-
transformers==4.26.1
184+
transformers==4.27.2
178185
# via unstructured-inference (setup.py)
179186
typing-extensions==4.5.0
180187
# via
@@ -183,12 +190,11 @@ typing-extensions==4.5.0
183190
# pydantic
184191
# starlette
185192
# torch
186-
# torchvision
187-
urllib3==1.26.14
193+
urllib3==1.26.15
188194
# via requests
189-
uvicorn==0.20.0
195+
uvicorn==0.21.1
190196
# via unstructured-inference (setup.py)
191197
wand==0.6.11
192198
# via pdfplumber
193-
zipp==3.14.0
199+
zipp==3.15.0
194200
# via importlib-resources

requirements/dev.txt

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ attrs==22.2.0
2121
# via jsonschema
2222
backcall==0.2.0
2323
# via ipython
24-
beautifulsoup4==4.11.2
24+
beautifulsoup4==4.12.0
2525
# via nbconvert
2626
bleach==6.0.0
2727
# via nbconvert
@@ -41,17 +41,22 @@ defusedxml==0.7.1
4141
# via nbconvert
4242
executing==1.2.0
4343
# via stack-data
44-
fastjsonschema==2.16.2
44+
fastjsonschema==2.16.3
4545
# via nbformat
4646
fqdn==1.5.1
4747
# via jsonschema
4848
idna==3.4
4949
# via
5050
# anyio
5151
# jsonschema
52-
ipykernel==6.21.2
52+
importlib-metadata==6.1.0
53+
# via
54+
# jupyter-client
55+
# nbconvert
56+
importlib-resources==5.12.0
57+
# via jsonschema
58+
ipykernel==6.22.0
5359
# via
54-
# ipywidgets
5560
# jupyter
5661
# jupyter-console
5762
# nbclassic
@@ -68,7 +73,7 @@ ipython-genutils==0.2.0
6873
# nbclassic
6974
# notebook
7075
# qtconsole
71-
ipywidgets==8.0.4
76+
ipywidgets==8.0.5
7277
# via jupyter
7378
isoduration==20.11.0
7479
# via jsonschema
@@ -87,8 +92,8 @@ jsonschema[format-nongpl]==4.17.3
8792
# jupyter-events
8893
# nbformat
8994
jupyter==1.0.0
90-
# via -r dev.in
91-
jupyter-client==8.0.3
95+
# via -r requirements/dev.in
96+
jupyter-client==8.1.0
9297
# via
9398
# ipykernel
9499
# jupyter-console
@@ -97,9 +102,9 @@ jupyter-client==8.0.3
97102
# nbclient
98103
# notebook
99104
# qtconsole
100-
jupyter-console==6.5.1
105+
jupyter-console==6.6.3
101106
# via jupyter
102-
jupyter-core==5.2.0
107+
jupyter-core==5.3.0
103108
# via
104109
# ipykernel
105110
# jupyter-client
@@ -113,15 +118,15 @@ jupyter-core==5.2.0
113118
# qtconsole
114119
jupyter-events==0.6.3
115120
# via jupyter-server
116-
jupyter-server==2.3.0
121+
jupyter-server==2.5.0
117122
# via
118123
# nbclassic
119124
# notebook-shim
120125
jupyter-server-terminals==0.4.4
121126
# via jupyter-server
122127
jupyterlab-pygments==0.2.2
123128
# via nbconvert
124-
jupyterlab-widgets==3.0.5
129+
jupyterlab-widgets==3.0.6
125130
# via ipywidgets
126131
markupsafe==2.1.2
127132
# via
@@ -133,17 +138,17 @@ matplotlib-inline==0.1.6
133138
# ipython
134139
mistune==2.0.5
135140
# via nbconvert
136-
nbclassic==0.5.1
141+
nbclassic==0.5.3
137142
# via notebook
138143
nbclient==0.7.2
139144
# via nbconvert
140-
nbconvert==7.2.9
145+
nbconvert==7.2.10
141146
# via
142147
# jupyter
143148
# jupyter-server
144149
# nbclassic
145150
# notebook
146-
nbformat==5.7.3
151+
nbformat==5.8.0
147152
# via
148153
# jupyter-server
149154
# nbclassic
@@ -155,7 +160,7 @@ nest-asyncio==1.5.6
155160
# ipykernel
156161
# nbclassic
157162
# notebook
158-
notebook==6.5.2
163+
notebook==6.5.3
159164
# via jupyter
160165
notebook-shim==0.2.2
161166
# via nbclassic
@@ -165,6 +170,7 @@ packaging==23.0
165170
# ipykernel
166171
# jupyter-server
167172
# nbconvert
173+
# qtconsole
168174
# qtpy
169175
pandocfilters==1.5.0
170176
# via nbconvert
@@ -174,16 +180,18 @@ pexpect==4.8.0
174180
# via ipython
175181
pickleshare==0.7.5
176182
# via ipython
177-
pip-tools==6.12.2
178-
# via -r dev.in
179-
platformdirs==3.0.0
183+
pip-tools==6.12.3
184+
# via -r requirements/dev.in
185+
pkgutil-resolve-name==1.3.10
186+
# via jsonschema
187+
platformdirs==3.1.1
180188
# via jupyter-core
181189
prometheus-client==0.16.0
182190
# via
183191
# jupyter-server
184192
# nbclassic
185193
# notebook
186-
prompt-toolkit==3.0.36
194+
prompt-toolkit==3.0.38
187195
# via
188196
# ipython
189197
# jupyter-console
@@ -211,11 +219,11 @@ python-dateutil==2.8.2
211219
# via
212220
# arrow
213221
# jupyter-client
214-
python-json-logger==2.0.6
222+
python-json-logger==2.0.7
215223
# via jupyter-events
216224
pyyaml==6.0
217225
# via jupyter-events
218-
pyzmq==25.0.0
226+
pyzmq==25.0.2
219227
# via
220228
# ipykernel
221229
# jupyter-client
@@ -224,7 +232,7 @@ pyzmq==25.0.0
224232
# nbclassic
225233
# notebook
226234
# qtconsole
227-
qtconsole==5.4.0
235+
qtconsole==5.4.1
228236
# via jupyter
229237
qtpy==2.3.0
230238
# via qtconsole
@@ -299,10 +307,14 @@ webencodings==0.5.1
299307
# tinycss2
300308
websocket-client==1.5.1
301309
# via jupyter-server
302-
wheel==0.38.4
310+
wheel==0.40.0
303311
# via pip-tools
304-
widgetsnbextension==4.0.5
312+
widgetsnbextension==4.0.6
305313
# via ipywidgets
314+
zipp==3.15.0
315+
# via
316+
# importlib-metadata
317+
# importlib-resources
306318

307319
# The following packages are considered to be unsafe in a requirements file:
308320
# pip

requirements/test.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ click>=8.1
88
# starlette even though it's required for TestClient
99
httpx
1010
flake8
11+
flake8-docstrings
1112
mypy
1213
pytest-cov
1314
pdf2image>=1.16.2

0 commit comments

Comments
 (0)