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.5k stars 429 forks source link

Results are not accurate when using MMdet 2.x version #166

Open Renat2001 opened 2 years ago

Renat2001 commented 2 years ago

Hi everyone! There is a problem with performance when using MMdet 2.x version. I used cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py config file. Also I updated checkpoint file epoch_36.pth with upgrade_model_version.py script. But anyways I am getting not accurate results. Table box is kind of shifted from its actual position. Steps to reproduce:

!pip install -U openmim
!mim install mmcv-full
!pip install mmdet
!pip uninstall opencv-python-headless==4.5.5.62
!pip install opencv-python-headless==4.1.2.30
import cv2 as cv
import numpy as np
from mmdet.apis import init_detector, inference_detector, show_result_pyplot
import mmcv
# Load model
config_file = '/content/drive/MyDrive/CascadeTabNet/cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py'
checkpoint_file = '/content/drive/MyDrive/CascadeTabNet/epoch_36_updated.pth'
model = init_detector(config_file, checkpoint_file, device='cuda:0')

# Test a single image 
img = "/content/drive/MyDrive/table_detection/data/handwritten/handwritten_image_9.png"

# Run Inference
result = inference_detector(model, img)

# Visualization results
show_result_pyplot(model, img, result, score_thr=0.50)

image

Kivin1 commented 2 years ago

same issue here

sid321axn commented 2 years ago

Is there any resolution to this issue. I am also facing the same issue with MMdet 2.1 version

np-n commented 2 years ago

Same issue here! cascadetabnet_output

Jsooooooo commented 1 year ago

I also run the image in Example/ using mmdet 2.26, the output xml is different from the example xml. There are also no cells, only table coord points image

marculera commented 1 year ago

Maybe because some weights are truncated when model migration is processed?

marculera commented 1 year ago

This guide helps dealing with this issue: https://github.com/open-mmlab/mmdetection/tree/master/configs/legacy_1.x