mmocr/tests/test_models/test_ocr_fuser.py
Tong Gao 9104667112
[Model] Full ABINet Framework (#651)
Co-authored-by: liukuikun <24622904+Harold-lkk@users.noreply.github.com>
2021-12-15 11:21:54 +08:00

13 lines
376 B
Python

# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmocr.models.textrecog.fusers import ABIFuser
def test_base_alignment():
model = ABIFuser(d_model=512, num_chars=90, max_seq_len=40)
l_feat = torch.randn(1, 40, 512)
v_feat = torch.randn(1, 40, 512)
result = model(l_feat, v_feat)
assert result['logits'].shape == torch.Size([1, 40, 90])