refactor: no need to inherit in python3 clean the code (#5659)

### What problem does this PR solve?

As title

### Type of change


- [x] Refactoring

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong
2025-03-05 18:03:53 +08:00
committed by GitHub
parent a64f4539e7
commit 4326873af6
13 changed files with 31 additions and 31 deletions

View File

@ -122,7 +122,7 @@ def load_model(model_dir, nm):
return loaded_model
class TextRecognizer(object):
class TextRecognizer:
def __init__(self, model_dir):
self.rec_image_shape = [int(v) for v in "3, 48, 320".split(",")]
self.rec_batch_num = 16
@ -393,7 +393,7 @@ class TextRecognizer(object):
return rec_res, time.time() - st
class TextDetector(object):
class TextDetector:
def __init__(self, model_dir):
pre_process_list = [{
'DetResizeForTest': {
@ -506,7 +506,7 @@ class TextDetector(object):
return dt_boxes, time.time() - st
class OCR(object):
class OCR:
def __init__(self, model_dir=None):
"""
If you have trouble downloading HuggingFace models, -_^ this might help!!