mirror of https://github.com/open-mmlab/mmocr.git
[Fix] textspotting ut (#1599)
parent
fa4fd1fd42
commit
5940d6bc9c
|
@ -13,7 +13,7 @@ from mmocr.utils import bbox2poly
|
||||||
from mmocr.visualization import TextSpottingLocalVisualizer
|
from mmocr.visualization import TextSpottingLocalVisualizer
|
||||||
|
|
||||||
|
|
||||||
class TestTextKIELocalVisualizer(unittest.TestCase):
|
class TestTextSpottingLocalVisualizer(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
h, w = 12, 10
|
h, w = 12, 10
|
||||||
|
@ -95,7 +95,7 @@ class TestTextKIELocalVisualizer(unittest.TestCase):
|
||||||
draw_pred=False,
|
draw_pred=False,
|
||||||
out_file=out_file)
|
out_file=out_file)
|
||||||
self._assert_image_and_shape(out_file, (h, w * 2, c))
|
self._assert_image_and_shape(out_file, (h, w * 2, c))
|
||||||
bboxes = self.data_sample.pred_instances.pop('bboxes')
|
bboxes = self.data_sample.pred_instances.get('bboxes')
|
||||||
bboxes = bboxes.tolist()
|
bboxes = bboxes.tolist()
|
||||||
polys = [bbox2poly(bbox) for bbox in bboxes]
|
polys = [bbox2poly(bbox) for bbox in bboxes]
|
||||||
self.data_sample.pred_instances.polygons = polys
|
self.data_sample.pred_instances.polygons = polys
|
||||||
|
|
Loading…
Reference in New Issue