MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / __init__

Method __init__

openrec/preprocess/dptr_label_encode.py:105–111  ·  view source on GitHub ↗
(self, charset: str)

Source from the content-addressed store, hash-verified

103 PAD = '[P]'
104
105 def __init__(self, charset: str) -> None:
106 specials_first = (self.EOS, )
107 specials_last = (self.BOS, self.PAD)
108 super().__init__(charset, specials_first, specials_last)
109 self.eos_id, self.bos_id, self.pad_id = [
110 self._stoi[s] for s in specials_first + specials_last
111 ]
112
113 def encode(self,
114 labels: List[str],

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected