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

Method __init__

tools/infer_e2e_parallel.py:29–44  ·  view source on GitHub ↗
(self, drop_score=0.5, det_box_type='quad', max_rec_threads=1)

Source from the content-addressed store, hash-verified

27class OpenOCRParallel:
28
29 def __init__(self, drop_score=0.5, det_box_type='quad', max_rec_threads=1):
30 cfg_det = Config(
31 './configs/det/dbnet/repvit_db.yml').cfg # mobile model
32 # cfg_rec = Config('./configs/rec/svtrv2/svtrv2_ch.yml').cfg # server model
33 cfg_rec = Config(
34 './configs/rec/svtrv2/repsvtr_ch.yml').cfg # mobile model
35 self.text_detector = OpenDetector(cfg_det, numId=0)
36 self.text_recognizer = OpenRecognizer(cfg_rec, numId=0)
37 self.det_box_type = det_box_type
38 self.drop_score = drop_score
39 self.queue = queue.Queue(
40 ) # Queue to hold detected boxes for recognition
41 self.results = {}
42 self.lock = threading.Lock() # Lock for thread-safe access to results
43 self.max_rec_threads = max_rec_threads
44 self.stop_signal = threading.Event() # Signal to stop threads
45
46 def start_recognition_threads(self):
47 """Start recognition threads."""

Callers

nothing calls this directly

Calls 3

ConfigClass · 0.90
OpenDetectorClass · 0.90
OpenRecognizerClass · 0.90

Tested by

no test coverage detected