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

Demo not working properly #172

Open
LidorPrototype opened this issue Nov 30, 2022 · 10 comments
Open

Demo not working properly #172

LidorPrototype opened this issue Nov 30, 2022 · 10 comments

Comments

@LidorPrototype
Copy link

I'm trying to run your demo, and I have a few problems.

first of all the command !gdown "https://drive.google.com/u/0/uc?id=1-QieHkR1Q7CXuBu4fp3rYrvDG9j26eFT" does not work, I get an access denied error so I download it manually
and after it I get the following error:
RuntimeError: unexpected EOF, expected 1939927 more bytes. The file might be corrupted.
this is from cell number 4., from the line: model = init_detector(config_file, checkpoint_file, device='cuda:0').

did anyone had this problem before? how one can fix this?

@parthplc
Copy link

Any update on this @DevashishPrasad @LidorPrototype ?

@lmmlzn
Copy link

lmmlzn commented Feb 9, 2023

Have you sloved it? I have met the same problem. Help. @parthplc @LidorPrototype @DevashishPrasad

@LidorPrototype
Copy link
Author

Still no solution sadly :(

@parthplc
Copy link

parthplc commented Feb 10, 2023

Hey @lmmlzn , I tried with different checkpoints and it worked well for me in colab.

conf_url = 'https://raw.githubusercontent.com/iiLaurens/CascadeTabNet/mmdet2x/Config/cascade_mask_rcnn_hrnetv2p_w32_20e.py'

with open('cascade_mask_rcnn_hrnetv2p_w32_20e.py', 'wb') as f:
  f.write(requests.get(conf_url).content)

checkpoint_url = 'https://github.com/iiLaurens/CascadeTabNet/releases/download/v1.0.0/ICDAR.19.Track.B2.Modern.table.structure.recognition.v2.pth'

with open('ICDAR.19.Track.B2.Modern.table.structure.recognition.v2.pth', 'wb') as f:
  f.write(requests.get(checkpoint_url).content)

demo_img = 'https://github.com/iiLaurens/CascadeTabNet/raw/mmdet2x/Demo/demo.png'

with open('demo.png', 'wb') as f:
  f.write(requests.get(demo_img).content)

use_torchvision=True

config_file = 'cascade_mask_rcnn_hrnetv2p_w32_20e.py'
checkpoint_file = 'ICDAR.19.Track.B2.Modern.table.structure.recognition.v2.pth'
model = init_detector(config_file, checkpoint_file, device='cpu')
img = "demo.png"
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
print(table_coordinates)

@onejlee
Copy link

onejlee commented Feb 13, 2023

@parthplc

I tried that solution, below error occurs to me.
this error caused by difference version between config file and checkpoint file.
I can't find checkpoint file of 1.x version.

TypeError: __init__() got an unexpected keyword argument 'roi_head'

@moran-trullion
Copy link

moran-trullion commented Feb 21, 2023

someone solved the issue?
probably we need to modify the config file again

@parthplc
Copy link

Hey, I have created this sample colab for reference @onejlee @moran-trullion .
Link : https://colab.research.google.com/drive/1BnBI4-tBVN8OOUedD652Md4Bd5b9jdzb?usp=sharing

@NotAbdelrahmanelsayed
Copy link

@parthplc I cant understand the output where is the table data?
[array([217, 63, 499, 360]), array([ 19, 395, 290, 467])]

@linkstatic12
Copy link

Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.5.1+cpu (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2, 2.0.0, 2.0.0+cpu, 2.0.0+cpu.cxx11.abi, 2.0.0+cu117, 2.0.0+cu117.with.pypi.cudnn, 2.0.0+cu118, 2.0.0+rocm5.3, 2.0.0+rocm5.4.2, 2.0.1, 2.0.1+cpu, 2.0.1+cpu.cxx11.abi, 2.0.1+cu117, 2.0.1+cu117.with.pypi.cudnn, 2.0.1+cu118, 2.0.1+rocm5.3, 2.0.1+rocm5.4.2)
ERROR: No matching distribution found for torch==1.5.1+cpu

Why does it say "No matching distribution found for torch" on my colab ?

@tzktz
Copy link

tzktz commented Jan 26, 2024

Hey, I have created this sample colab for reference @onejlee @moran-trullion . Link : https://colab.research.google.com/drive/1BnBI4-tBVN8OOUedD652Md4Bd5b9jdzb?usp=sharing

In config url config file were missing..pls check tat..!!

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

8 participants