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

Function test_textdecoder_no_eos

tests/test_utils.py:56–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54
55
56def test_textdecoder_no_eos():
57 chars_dict = {"<PAD>": 0, "<EOS>": 1, "A": 2, "B": 3, "C": 4}
58 decoder = TextDecoder(chars_dict=chars_dict, decode_mode=DecodeMode.Normal)
59 row = np.array([2, 3, 4, 0], dtype=np.int32)
60 result = decoder.decode([row])
61 assert result == ["ABC"]
62
63
64def test_textdecoder_ctc():

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.95
TextDecoderClass · 0.90

Tested by

no test coverage detected