-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add paddleocr #83
base: main
Are you sure you want to change the base?
add paddleocr #83
Conversation
if return_response: | ||
return res | ||
|
||
if return_only_text: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- A score is needed to filter the recognition results and corresponded polys.
- The format should be same as other agents
|
||
DEPENDENCIES = ["paddleocr"] | ||
|
||
def __init__(self, languages="en", use_gpu=True, use_angle_cls=False, det=True, rec=True, cls=False, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- default value of
use_gpu
should be False for better compatibility.
Whether return only the texts in the OCR results. | ||
Defaults to `False`. | ||
""" | ||
image = self.resized_long(image) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we can not modify target=480
, the value is suggested to be an initialization parameter of PaddleOCRAgent
class.
|
||
def pad_img_to_longer_edge(self, image): | ||
max_shape = max(image.shape[0], image.shape[1]) | ||
out_img = np.ones([max_shape, max_shape, 3]) * 127 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
127 is also suggested to be set as fixable for some others special situations.
I'vd added paddleocr model and test code. Please check whether there is anything to be modified, thx.