mirror of https://github.com/open-mmlab/mmocr.git
[Feature] Save filename in text detection test results (#570)
* save filename in textdet test results * fix pytestpull/574/head
parent
37f8fcd841
commit
9f42d78db7
|
@ -59,7 +59,9 @@ class HeadMixin:
|
|||
boundaries = self.resize_boundary(
|
||||
boundaries,
|
||||
1.0 / self.downsample_ratio / img_metas[0]['scale_factor'])
|
||||
results = dict(boundary_result=boundaries)
|
||||
results = dict(
|
||||
boundary_result=boundaries, filename=img_metas[0]['filename'])
|
||||
|
||||
return results
|
||||
|
||||
def loss(self, pred_maps, **kwargs):
|
||||
|
|
|
@ -380,7 +380,8 @@ def test_textsnake(cfg_file):
|
|||
|
||||
one_meta = img_metas[0]
|
||||
result = detector.bbox_head.get_boundary(maps, [one_meta], False)
|
||||
assert len(result) == 1
|
||||
assert 'boundary_result' in result
|
||||
assert 'filename' in result
|
||||
|
||||
# Test show result
|
||||
results = {'boundary_result': [[0, 0, 1, 0, 1, 1, 0, 1, 0.9]]}
|
||||
|
@ -519,7 +520,7 @@ def test_drrg(cfg_file):
|
|||
detector.bbox_head.out_conv.bias.data.fill_(0.)
|
||||
outs = detector.bbox_head.single_test(maps)
|
||||
boundaries = detector.bbox_head.get_boundary(*outs, img_metas, True)
|
||||
assert len(boundaries)
|
||||
assert len(boundaries) == 1
|
||||
|
||||
# Test show result
|
||||
results = {'boundary_result': [[0, 0, 1, 0, 1, 1, 0, 1, 0.9]]}
|
||||
|
|
Loading…
Reference in New Issue