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

Mismatch on show_result_pyplot function (can not work locally) #95

Open busekuz opened 3 years ago

busekuz commented 3 years ago

Hi,

I've been trying to test this project on my local computer lately (rather than colab) but I've faced some issues. I used the prediction code at the demo as,

from mmdet.apis import init_detector, inference_detector, show_result_pyplot 
import mmcv
config_file = '/content/CascadeTabNet/Config/cascade_mask_rcnn_hrnetv2p_w32_20e.py'
checkpoint_file = '/content/epoch_36.pth'
model = init_detector(config_file, checkpoint_file, device='cuda:0')
img = "./test.png"
result = inference_detector(model, img)
show_result_pyplot(img, result,('Bordered', 'cell', 'Borderless'), score_thr=0.85)

Then I tried to modify show_result_pyplot so that I can save some result images to my computer.

But I've seen that show_result_pyplot has a different signature as,

def show_result_pyplot(model, img, result, score_thr=0.3, fig_size=(15, 10))

So the show_result_pyplot we have called at the prediction does not match with the definition at mmdet.apis (there is an extra model parameter at signature) I'm not sure how this works at the colab demo but it doesn't work locally.

If I'm missing something please let me now

Thanks!