MCPcopy Create free account
hub / github.com/DocsaidLab/MRZScanner / test_textdecoder_call

Function test_textdecoder_call

tests/test_utils.py:72–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70
71
72def test_textdecoder_call():
73 chars_dict = {"<PAD>": 0, "<EOS>": 1, "A": 2, "B": 3, "C": 4}
74 decoder = TextDecoder(chars_dict=chars_dict, decode_mode=DecodeMode.Normal)
75 row = np.array([2, 3, 4, 1, 0], dtype=np.int32)
76 result = decoder(row[np.newaxis])
77 assert result == ["ABC"]
78
79# 測試多列輸入的情況
80

Callers

nothing calls this directly

Calls 1

TextDecoderClass · 0.90

Tested by

no test coverage detected