Skip to content

Commit

Permalink
Merge pull request #866 from myhloli/dev
Browse files Browse the repository at this point in the history
fix(table): improve table image processing
  • Loading branch information
myhloli authored Nov 5, 2024
2 parents 7ec3a65 + 401dfa4 commit 7ca195e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion docs/README_Ubuntu_CUDA_Acceleration_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|-----------------------------------------+----------------------+----------------------+
Expand Down
4 changes: 3 additions & 1 deletion magic_pdf/model/ppTableModel.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import cv2
from paddleocr.ppstructure.table.predict_table import TableSystem
from paddleocr.ppstructure.utility import init_args
from magic_pdf.libs.Constants import *
Expand Down Expand Up @@ -36,7 +37,8 @@ def img2html(self, image):
- 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(
Expand Down

0 comments on commit 7ca195e

Please sign in to comment.