mindspore-lab / mindocr

A toolbox of ocr models and algorithms based on MindSpore

Home Page:https://mindspore-lab.github.io/mindocr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in det_base_postprocess.py

HaoyangLee opened this issue · comments

  • Problem
    In mindocr/postprocess/det_base_postprocess.py, according to the type hint, pred could be a Tuple of tensor,

    def __call__(self, pred: Union[ms.Tensor, Tuple[ms.Tensor], np.ndarray],

    which incur bug in
    assert shape_list.shape[0] == pred.shape[0] and shape_list.shape[1] == 4, \

  • Potential solution:
    Assert shape_list.shape[0] equals to each tensor.shape[0] in pred Tuple. The shape of shape_list is supposed to be [N, 4]. The shape of pred or of each tensor in pred is supposed to be [N, ...]