MCPcopy Create free account
hub / github.com/PaddlePaddle/PaddleOCR / encode

Method encode

ppocr/data/imaug/label_ops.py:1635–1643  ·  view source on GitHub ↗
(self, text_seq)

Source from the content-addressed store, hash-verified

1633 )
1634
1635 def encode(self, text_seq):
1636 text_seq_encoded = []
1637 for text in text_seq:
1638 if text not in self.character:
1639 continue
1640 text_seq_encoded.append(self.dict.get(text))
1641 if len(text_seq_encoded) == 0:
1642 return None
1643 return text_seq_encoded
1644
1645 def __call__(self, data):
1646 label = data["label"]

Callers 1

__call__Method · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected