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
7ca195e7
Unverified
Commit
7ca195e7
authored
Nov 05, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Nov 05, 2024
Browse files
Merge pull request #866 from myhloli/dev
fix(table): improve table image processing
parents
7ec3a653
401dfa4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
+0
-1
magic_pdf/model/ppTableModel.py
magic_pdf/model/ppTableModel.py
+3
-1
No files found.
docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
View file @
7ca195e7
...
@@ -11,7 +11,6 @@ nvidia-smi
...
@@ -11,7 +11,6 @@ nvidia-smi
注意:
`CUDA Version`
显示的版本号应 >= 12.1,如显示的版本号小于12.1,请升级驱动
注意:
`CUDA Version`
显示的版本号应 >= 12.1,如显示的版本号小于12.1,请升级驱动
```
plaintext
```
plaintext
```
+---------------------------------------------------------------------------------------+
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 537.34 Driver Version: 537.34 CUDA Version: 12.2 |
| NVIDIA-SMI 537.34 Driver Version: 537.34 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
|-----------------------------------------+----------------------+----------------------+
...
...
magic_pdf/model/ppTableModel.py
View file @
7ca195e7
import
cv2
from
paddleocr.ppstructure.table.predict_table
import
TableSystem
from
paddleocr.ppstructure.table.predict_table
import
TableSystem
from
paddleocr.ppstructure.utility
import
init_args
from
paddleocr.ppstructure.utility
import
init_args
from
magic_pdf.libs.Constants
import
*
from
magic_pdf.libs.Constants
import
*
...
@@ -36,7 +37,8 @@ class ppTableModel(object):
...
@@ -36,7 +37,8 @@ class ppTableModel(object):
- HTML (str): A string representing the HTML structure with content of the table.
- HTML (str): A string representing the HTML structure with content of the table.
"""
"""
if
isinstance
(
image
,
Image
.
Image
):
if
isinstance
(
image
,
Image
.
Image
):
image
=
np
.
array
(
image
)
image
=
np
.
asarray
(
image
)
image
=
cv2
.
cvtColor
(
image
,
cv2
.
COLOR_RGB2BGR
)
pred_res
,
_
=
self
.
table_sys
(
image
)
pred_res
,
_
=
self
.
table_sys
(
image
)
pred_html
=
pred_res
[
"html"
]
pred_html
=
pred_res
[
"html"
]
# res = '<td><table border="1">' + pred_html.replace("<html><body><table>", "").replace(
# res = '<td><table border="1">' + pred_html.replace("<html><body><table>", "").replace(
...
...
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