RapidAI / RapidStructure

版面分析 | 表格识别 | 文档方向分类
Apache License 2.0
182 stars 14 forks source link

运行rapid_main.py出错 #14

Closed ilovesouthpark closed 8 months ago

ilovesouthpark commented 8 months ago

(python) C:\Users\jft\RapidStructure>python rapid_main.py [{'bbox': array([321.4160495 , 91.53214898, 562.06141263, 199.85522603]), 'label': 'text'}, {'bbox': array([ 58.67292211, 107.29000663, 300.25448676, 199.68142785]), 'label': 'text'}, {'bbox': array([321.70215978, 696.30348399, 561.81311168, 804.21204653]), 'label': 'text'}, {'bbox': array([ 56.13823644, 662.91114981, 305.76807089, 722.45002322]), 'label': 'text'}, {'bbox': array([ 60.03535906, 91.66820167, 249.37660473, 101.83736896]), 'label': 'title'}, {'bbox': array([ 61.19376827, 730.4047943 , 298.66428215, 787.99057095]), 'label': 'figure'}, {'bbox': array([ 80.07031778, 793.84156441, 278.21548591, 803.10274913]), 'label': 'figure_caption'}, {'bbox': array([355.79846928, 664.8275131 , 527.14342833, 689.68965201]), 'label': 'figure_caption'}, {'bbox': array([ 56.84690797, 234.85342862, 565.57721203, 491.91314587]), 'label': 'table'}, {'bbox': array([ 56.29500252, 525.46281841, 566.19082647, 647.91365501]), 'label': 'table'}, {'bbox': array([168.15167659, 205.71483414, 453.00579995, 232.4013521 ]), 'label': 'table_caption'}, {'bbox': array([230.31146447, 499.74774696, 455.9769955 , 526.09080024]), 'label': 'table_caption'}, {'bbox': array([356.1792743 , 664.69523244, 526.8971846 , 689.50478026]), 'label': 'table_caption'}] [[ 57 235 566 492] [ 56 525 566 648]] Traceback (most recent call last): File "C:\Users\jft\RapidStructure\rapid_main.py", line 106, in test_input() File "C:\Users\jft\RapidStructure\rapid_main.py", line 94, in test_input table_htmlstr, = table_engine(cropped_img, ocr_result) ^^^^^^^^^^^^^^^^^ ValueError: too many values to unpack (expected 2)

使用的是test文件夹里的图片

SWHL commented 8 months ago

参考最新文档发自我的iPhone

ilovesouthpark commented 8 months ago

望指点,是说的那个最新文档,repo没看到有昨天以后的更新。谢谢

SWHL commented 8 months ago

返回值有3个,多加一个返回值就行了。可以看看源码

SWHL commented 8 months ago

这个错误是因为表格识别模块,返回值部分增加了一个cell框坐标的值,导致的。仓库中对应部分已经修复。 https://github.com/RapidAI/RapidStructure/blob/513d4f7863ed68d9fb7ea81fd2438bb8589cd7d3/rapid_main.py#L94

ilovesouthpark commented 8 months ago

可以了,正在思索返回值的问题,谢谢。demo那里也可以改一下

SWHL commented 8 months ago

可以了,正在思索返回值的问题,谢谢。demo那里也可以改一下

demo这里已经更改 https://github.com/RapidAI/RapidStructure/blob/513d4f7863ed68d9fb7ea81fd2438bb8589cd7d3/demo.py#L58