Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
cuhk-hbsun committed Aug 3, 2021
1 parent 2365330 commit 1b6c11d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/test_models/test_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def test_base_recognizer():
assert feat.shape == torch.Size([1, 512, 1, 41])

# test forward train
img_metas = [{'text': 'hello', 'resize_shape': (32, 120, 3), 'valid_ratio': 1.0}]
img_metas = [{
'text': 'hello',
'resize_shape': (32, 120, 3),
'valid_ratio': 1.0
}]
losses = recognizer.forward_train(imgs, img_metas)
assert isinstance(losses, dict)
assert 'loss_ctc' in losses
Expand Down Expand Up @@ -162,7 +166,11 @@ def test_seg_recognizer():
gt_kernels = BitmapMasks([attn_tgt, segm_tgt, mask], 64, 256)

# test forward train
img_metas = [{'text': 'hello', 'resize_shape': (64, 256, 3), 'valid_ratio': 1.0}]
img_metas = [{
'text': 'hello',
'resize_shape': (64, 256, 3),
'valid_ratio': 1.0
}]
losses = recognizer.forward_train(imgs, img_metas, gt_kernels=[gt_kernels])
assert isinstance(losses, dict)

Expand Down

0 comments on commit 1b6c11d

Please sign in to comment.