Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
7ca195e7
Unverified
Commit
7ca195e7
authored
Nov 05, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Nov 05, 2024
Browse files
Options
Browse Files
Download
Plain Diff
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
README_Ubuntu_CUDA_Acceleration_zh_CN.md
docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
+0
-1
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
注意:
`CUDA Version`
显示的版本号应 >= 12.1,如显示的版本号小于12.1,请升级驱动
```
plaintext
```
+---------------------------------------------------------------------------------------+
| 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.utility
import
init_args
from
magic_pdf.libs.Constants
import
*
...
...
@@ -36,7 +37,8 @@ class ppTableModel(object):
- HTML (str): A string representing the HTML structure with content of the table.
"""
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_html
=
pred_res
[
"html"
]
# 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