CascadeTabNet icon indicating copy to clipboard operation
CascadeTabNet copied to clipboard

How to crop out the detected tables ?

Open Yugabharathi opened this issue 3 years ago • 7 comments

We were able to detect the tables properly but we also want the coordinates of the table for further process .can you give us a any solution to get the coordinates of detected tables ?

Yugabharathi avatar Dec 27 '21 06:12 Yugabharathi

@Yugabharathi you are getting the coordinates of the tabular region. I am writing one blog post in which end to end implementation. I will provide from model loading on CPU as well as GPU for Linux as well as windows.

mohit-217 avatar Jan 08 '22 11:01 mohit-217

Hi @themohitkumar,

Could you share the link to the blog post once u finished writing? Thanks in advance :)

PoornaSaiNagendra avatar Jan 10 '22 05:01 PoornaSaiNagendra

We were able to detect the tables properly but we also want the coordinates of the table for further process .can you give us a any solution to get the coordinates of detected tables ?

same here

nidhiipatelll avatar Mar 28 '22 01:03 nidhiipatelll

@Yugabharathi Using the below code snippet after having done inference one can extract table co-ordinates

from numpy import array, float32

result = inference_detector(model, img)
table_coordinates = []

## extracting bordered tables
for bordered_tables in result[0][0]:
	table_coordinates.append(bordered_tables[:4].astype(int))

## extracting borderless tables
for borderless_tables in result[0][2]:
	table_coordinates.append(borderless_tables[:4].astype(int))	

## print tables
for table in table_coordinates:
	x1 = table[0]
	x2 = table[2]
	y1 = table[1]
	y2 = table[3]

	print(f"Table with start co-ordinate ({x1}, {y1}) and end co-ordinate ({x2}, {y2})" %x1 %y1 %x2 %y2)

shivam07a avatar Jul 06 '22 13:07 shivam07a

Hey @shivam07a , How to get threshold for each table with this? Any idea? Also how you know how to interpret result variable

parthplc avatar Jul 21 '22 10:07 parthplc

with the given coordinate how to extract the table image?

AGRocky avatar Jul 11 '23 09:07 AGRocky