Commit 69cdea90 authored by myhloli's avatar myhloli
Browse files

fix(ocr): switch to ch_lite model for Chinese OCR on CPU

- Automatically change to ch_lite model when using CPU for Chinese OCR
- This modification improves performance on CPU devices
parent 1d1c7ba9
......@@ -53,6 +53,11 @@ class PytorchPaddleOCR(TextSystem):
args = parser.parse_args(args)
self.lang = kwargs.get('lang', 'ch')
device = get_device()
if device == 'cpu' and self.lang == 'ch':
self.lang = 'ch_lite'
if self.lang in latin_lang:
self.lang = 'latin'
elif self.lang in arabic_lang:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment