Git Product home page Git Product logo

table-detect's Introduction

table-detect

table detect(yolo) , table line(unet) (表格检测/表格单元格定位)

links(下载链接): http://gofile.me/4Nlqh/fNHlWzVWo
download models weights and move to ./modes

test table detect(表格检测)

python table_detect.py --jpgPath img/table-detect.jpg

test table ceil detect with unet(表格识别输出到excel)

python table_ceil.py --isToExcel True --jpgPath img/table-detect.jpg

train table line(训练表格)

label table with labelme(https://github.com/wkentaro/labelme)

python train/train.py

table-detect's People

Contributors

wenlihaoyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

table-detect's Issues

数据标注问题

大佬您好,我想问一下,数据标注的时候,我看tablenet分成了两类,如果横向和纵向重叠的时候,该如何分类呢 @ @wenlihaoyu

关于数据集的问题

首先,非常感谢您的分享。我尝试了表格识别,然后后处理稍微修改一点,效果非常棒。
其中,如果我想 迁移学习,有什么公开数据集可以训练unet么?
下载了TableBank和其他的,他们的标签要么作表格检测,要么是预测 表格单元关系。
不会真的都要用 LabelImage制作segmentation img吧。 手动狗头

无线表格

该模型是不支持无线表格的分割吧

Error

您好,请问下模型和cfg文件不匹配怎么解决?

线条检测不准

训练出来之后,用训练的图片测试,线条检测准
edc36cf4-803f-11ed-947d-18c04dbd683e
但重新拍照检测又不准了,这个会是什么问题
Uploading 9ef66d98-80ca-11ed-b0d0-18c04dbd683e.png…

识别问题

检测完单元格后,对单元格的内容进行识别,会把表格的边框当成是文字进行识别,想问下这个问题怎么解决

关于分割

您好,请问下如果不做检测,直接分割,为什么会产生这样的列分割线?? 无边框的也可以分割吗?
7AC44275-3F10-4BDB-B99F-EBAF99E3C774
Uploading 5B54C8D5-B8C6-4462-9490-ACE929C1A35C.jpeg…

关于用自己训练数据,table_ceil.py报错

作者代码里train.py,训练是在table-line.h5 基础上迁移学习,我使用自己的数据,table_line.py,注释model.load_weights(tableModeLinePath),训练出来的模型,在运行预测table_ceil.py,报错,运行table_line.py,不报错,但是预测图片没有任何线条
GeForce GTX 1080 Ti, pci bus id: 0000:00:06.0, compute capability: 6.1) 1 Physical GPUs, 1 Logical GPUs 2020-10-15 17:30:16.059743: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 Traceback (most recent call last): File "table_ceil.py", line 105, in <module> tableDetect = table(img) File "table_ceil.py", line 25, in __init__ self.table_ceil() ##表格单元格定位 File "table_ceil.py", line 71, in table_ceil ceilboxes[:, [0, 2, 4, 6]] += xmin IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Issue with accuracy and loss during training

Hello,

I tried training a model with my own data after annotating it using label-me. But while training I observed that my training loss is not converging nor is my accuracy increasing. It is stuck within a range of values (0.45 - 0.55 for accuracy). Any Idea why this is happening ?

检测到的横竖线中间被截断,或者整条横竖线不能被完全检测,只能检测到横竖线的部分线段如下图

标注了500张图片重新训练tableline模型,其中标注数据中有手拍表格图片,所以对于拍摄变形的图片中的表格横竖线,某一条横线如果只用一条横线标注,可能不能完全重合,因此一条横线可能被分成了两段或者三段横线进行标注。训练了10epoch,最终训练集上acc稳定到了0.99左右,loss0.019左右,但是用训练后的模型,在训练集上推理,检测到的横竖线效果很不好,同一条线段可能只能检测到线段上的部分,而不能完全检测整条线段。
请问是标注的训练数据的问题嘛,是不是训练数据的横竖线必须是横平
table-line
竖直那种横线,如果对于有拍摄畸变的图片,对于畸变横线标注时候也必须用一条横线标注,还是可以畸变横线被分成两段或者三段进行标注呢。
请问是训练数据太少呢,还是标注数据的问题呢还是训练epoch太少的原因呢,您给出的模型是用多少数据训练的呢

unet主干网络sigmoid选用

作者您好,感谢您对于表格识别的杰出工作,我这里现在有个问题
classify = Conv2D(num_classes, (1, 1), activation='sigmoid')(up0a)
这里既然num_classes是2,多分类问题了,为啥选用sigmoid作为激活函数呢?

训练数据集

尊敬的作者:
您好。
下载了您预训练好的表格线识别模型,效果挺好。想请教一下,您训练table-line这个模型,用的什么数据集。我看到您的代码目录里有5张用于训练表格线的图片及标注。难道就只是用这5张图片训练的吗?

utils.py模块中的adjust_lines函数存在使得line_to_line函数报分母为0的BUG

r = sqrt((x2, y2), (x3, y3))

稳定触发报错的例子:
1.ColsLines[i] = (189,5,189,92);ColsLines[j] = (202, 92, 202, 396),即(x2,y2) = (189, 92),(x3,y3) = (202, 92),r = sqrt((x2, y2), (x3, y3)) < alph 成立
2.会执行newColsLines.append([x2, y2, x3, y3]),但此处显然[189,92,202,92]是一条横线
3.newColsLines列表里混入横线后,运行到line_to_line函数时,只要与[189,92,202,92]计算的另一条横线y值相同,就会导致fit_line时直线系数A为0

A = y2 - y1

4.最后导致分母"A1B2-A2B1"为0报错
x = (B1 * C2 - B2 * C1) / (A1 * B2 - A2 * B1)

5.同样adjust_lines函数第152,156,176行这三条分支都会触发上述错误

问题导致原因:
RowsLines循环时,两条row_line特殊情况会产生一条垂直的col_line,需要增加判断条件加到newColsLines而非newRowsLines,ColsLines循环同理。

解决方案:增加调整后新增线段是否水平垂直

# 其他情况同理
r = sqrt((x1, y1), (x4, y4))
delta_x = x1 - x4
if r < alph:
    if delta_x == 0.0:
        newColsLines.append([x1, y1, x4, y4])
    else:
        newRowsLines.append([x1, y1, x4, y4])

训练

感谢您的分享,请问有训练模型的工程吗?

Datasource / Paper?

Hi,

I am keen to know if there is any research information available about the line detection model. Is the model based on a paper? How and where did you get the training data set?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.