Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in blessFunc.py borderless ,why cur_cell=-1?how to fix this error? #183

Open
MathamPollard opened this issue Apr 23, 2024 · 0 comments
Open

Comments

@MathamPollard
Copy link

In blessFunc.py borderless,Icame across this error:
MergedBoxes = []
for cellrow in cellBoxes2BeMerged:
cellrow = sorted(cellrow,key=lambda x: x[0])
cur_cell = -1
for c,cell in enumerate(cellrow):
if(cur_cell == -1):
cur_cell = cell
continue
if(len(cellrow)==1):
MergedBoxes.append(cell)
break
if(abs((cur_cell[0]+cur_cell[2])-cell[0]) < 10):
cur_cell[2] = cur_cell[2] + cell[2] + (cell[0]- (cur_cell[0]+cur_cell[2]))
if(cur_cell[3]<cell[3]):
cur_cell[3]=cell[3]
else:
cur_cell[2] = cur_cell[0]+cur_cell[2]
cur_cell[3] = cur_cell[1]+cur_cell[3]
MergedBoxes.append(cur_cell)
cur_cell = cell
cur_cell[2] = cur_cell[0]+cur_cell[2]
发生异常: TypeError
'int' object is not subscriptable
File "/home/mdisk1/tanjunwen/CascadeTabNet/Table_Structure_Recognition/Functions/blessFunc.py", line 260, in borderless
cur_cell[2] = cur_cell[0]+cur_cell[2]
File "/home/mdisk1/tanjunwen/CascadeTabNet/Table_Structure_Recognition/myown_infer.py", line 104, in
root.append(borderless(res,cv2.imread(filepath),res_cell))
TypeError: 'int' object is not subscriptable

what do it mean when cur_cell=-1? While I train and infer on my own dataset iFLYTAB,about 10% samples will raise this error,I just ignore these samples now.Could you please tell me how to fix this error??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant