Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add paddleocr #83

wants to merge 2 commits into from

Conversation

an1018
Copy link
Contributor

@an1018 an1018 commented Sep 26, 2021

I'vd added paddleocr model and test code. Please check whether there is anything to be modified, thx.

if return_response:
return res

if return_only_text:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. A score is needed to filter the recognition results and corresponded polys.
  2. 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):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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)

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants