AmanSavaria1402 / TableNet

TableNet: Deep Learning model for end-to-end Table Detection and Tabular data extraction from Scanned Data Images In modern times, more and more number of people are sharing their documents as photos taken from smartphones. A lot of these documents contain lots of information in one or more tables. These tables often contain very important information and extracting this information from the image is a task of utmost importance. In modern times, information extraction from these tables is done manually, which requires a lot of effort and time and hence is very inefficient. Therefore, having an end-to-end system that given only the document image, can recognize and localize the tabular region and also recognizing the table structure (columns) and then extract the textual information from the tabular region automatically will be of great help since it will make our work easier and much faster. TableNet is just that. It is an end-to-end deep learning model that can localize the tabular region in a document image, understand the table structure and extract text data from it given only the document image. Earlier state-of-the-art deep learning methods took the two problems, that is, table detection and table structure recognition (recognizing rows and columns in the table) as separate and treated them separately. However, given the interdependence of the two tasks, TableNet considers them as two related sub-problems and solves them using a single neural network. Thus, also making it relatively lightweight and less compute intensive solution.
43 stars 7 forks source link

FileNotFoundError on opening streamlit app using `streamlit run app.py` #1

Open 004Ajay opened 1 year ago

004Ajay commented 1 year ago

@AmanSavaria1402 I tried the code for detecting a table in an image, but the code shows an error while opening in streamlit The error:

FileNotFoundError: [Errno 2] Unable to open file (unable to open file: name = 'DenseNet-Tablenet.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

Traceback: File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "C:\Users\ASUS\Downloads\TableNet-main\app.py", line 244, in tablenet = ModelConstructor() File "C:\Users\ASUS\Downloads\TableNet-main\app.py", line 133, in ModelConstructor tablenet.load_weights('DenseNet-Tablenet.h5') File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\h5py_hl\files.py", line 533, in init fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr) File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\h5py_hl\files.py", line 226, in make_fid fid = h5f.open(name, flags, fapl=fapl) File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py\h5f.pyx", line 106, in h5py.h5f.open

image

adam-harwood commented 7 months ago

I hit this error too. The answer is in the README:

For the pre-trained model weights, download them from [here](https://drive.google.com/file/d/11cl-QP5xsYmuM-IwCtc1psMH14bb7kFx/view?usp=sharing) and rename the file to DenseNet-Tablenet.h5 and keep it in the same directory as the webapp script.