DevashishPrasad / CascadeTabNet

This repository contains the code and implementation details of the CascadeTabNet paper "CascadeTabNet: An approach for end to end table detection and structure recognition from image-based documents"
MIT License
1.46k stars 422 forks source link

TypeError: 'int' object is not subscriptable #79

Open Atul997 opened 3 years ago

Atul997 commented 3 years ago

While passing an specific image to the pipeline it throws an error mentioned below-

~/Desktop/CascadeTabNet/Table Structure Recognition/Functions/blessFunc.py in borderless(table, image_path, res_cells)
 330           MergedBoxes.append(cur_cell)
 331           cur_cell = cell
 --> 332       cur_cell[2] = cur_cell[0]+cur_cell[2]
  333       cur_cell[3] = cur_cell[1]+cur_cell[3]
   334       MergedBoxes.append(cur_cell)

TypeError: 'int' object is not subscriptable

I checked to print the Mergedboxes list but it is not printing anything. It's strange that this was working yesterday but not today. Can you help me out ?

Atul997 commented 3 years ago

Can anybody please help me out with this issue?

narenderkumarnain commented 3 years ago

I am also facing the same error, did you solved it?

chngn627 commented 2 years ago

In file blessFunc.py add a conditional statement to check if 'cellrow' is empty, after line 240, like this:

> 239    for cellrow in cellBoxes2BeMerged:
> 240      cellrow = sorted(cellrow,key=lambda x: x[0])
> 241      if len(cellrow) == 0:
> 242        continue