feat: support multiple OCR parameter sets and improve text selection accuracy#86
feat: support multiple OCR parameter sets and improve text selection accuracy#86
Conversation
a8f7a86 to
a2fa3f4
Compare
There was a problem hiding this comment.
Pull Request Overview
Enhance OCRProcessor to accept multiple OCR configurations and select the most comprehensive text result per image, adjusting the entry point to use the new ocr_params_list.
- Refactored
OCRProcessor.__init__andget_ocr_resultto handle a list of parameter sets. - Updated
single_recto iterate over all engines and pick the longest text output. - Changed
RapidVideOCRInputandRapidVideOCRinmain.pyto useocr_params_list.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rapid_videocr/ocr_processor.py | Support multiple OCR parameter sets in single_rec, updated engine initialization and result logic. |
| rapid_videocr/main.py | Replaced ocr_params with ocr_params_list in input schema and processor instantiation. |
Comments suppressed due to low confidence (1)
rapid_videocr/ocr_processor.py:61
- Add unit tests to verify that
single_recselects the longest text among multiple OCR parameter sets, covering this conditional branch.
if max_txt_len < len(txts):
|
Thanks, and I will merge it later. |
Thank you. |
|
I'm really sorry for the late response; I've only just found the time to look into RapidVideOCR recently. I've carefully reviewed your submission. The core idea is to instantiate multiple OCR instances with different configurations simultaneously, perform multiple recognitions on the same image, and select the longest result as the final output. However, this approach would lead to increased resource consumption. Out of curiosity, could you please share what specific scenario prompted you to consider this solution? |
Changes
ocr_params_list) instead of a single config.multiprocessing.Pool) can optionally be used to speed up processing by running different parameter sets in parallel.Notes
ocr_params_listis not provided.