Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
MinerU
Commits
57e0af48
Unverified
Commit
57e0af48
authored
Jan 06, 2025
by
Xiaomeng Zhao
Committed by
GitHub
Jan 06, 2025
Browse files
Merge pull request #1421 from myhloli/dev
fix(table): handle empty OCR result in rapidtable
parents
d76ec7da
12caa784
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
magic_pdf/model/sub_modules/table/rapidtable/rapid_table.py
magic_pdf/model/sub_modules/table/rapidtable/rapid_table.py
+4
-1
No files found.
magic_pdf/model/sub_modules/table/rapidtable/rapid_table.py
View file @
57e0af48
...
...
@@ -27,8 +27,11 @@ class RapidTableModel(object):
elif
self
.
ocr_model_name
==
"PaddleOCR"
:
bgr_image
=
cv2
.
cvtColor
(
np
.
asarray
(
image
),
cv2
.
COLOR_RGB2BGR
)
ocr_result
=
self
.
ocr_engine
.
ocr
(
bgr_image
)[
0
]
ocr_result
=
[[
item
[
0
],
item
[
1
][
0
],
item
[
1
][
1
]]
for
item
in
ocr_result
if
if
ocr_result
:
ocr_result
=
[[
item
[
0
],
item
[
1
][
0
],
item
[
1
][
1
]]
for
item
in
ocr_result
if
len
(
item
)
==
2
and
isinstance
(
item
[
1
],
tuple
)]
else
:
ocr_result
=
None
else
:
logger
.
error
(
"OCR model not supported"
)
ocr_result
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment