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

TypeError: "img" must be a numpy array or a str or a pathlib.Path object #149

Open yassinesefrioui opened 2 years ago

yassinesefrioui commented 2 years ago

hello, i try to show result by the but it is not working, can you help me ?

from mmdet.models import build_detector
from mmdet.apis import inference_detector, init_detector
from mmdet.models.detectors import BaseDetector
%cd {mmdetection_dir}
score_thr = 0.8
# build the model from a config file and a checkpoint file
model = init_detector(config_fname, checkpoint_file)
import cv2
# test a single image and show the results
img = 'data/VOCdevkit/VOC2007/JPEGImages/15.jpg'
result = inference_detector(model, img)
BaseDetector.show_result(img, result, model.CLASSES, score_thr=score_thr, out_file="./result.jpg")

Error : TypeError: "img" must be a numpy array or a str or a pathlib.Path object

the path of my image is valid.