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

Paddle OCR Parser #64

Merged
merged 10 commits into from
Sep 11, 2024
Merged

Paddle OCR Parser #64

merged 10 commits into from
Sep 11, 2024

Conversation

aljazkonec1
Copy link
Contributor

Paddle OCR model outputs a sequence of classification probabilities for each possible character at each sequence step.

This PR adds a general postprocessing function, classification_sequence_message, that can be used for this model and similar ones. The classification_sequence_message finds the class (in the case of OCR: characters) with the maximum probability at each sequence step. It can optionally remove unwanted classes (such as padding, background, or blank characters) from the sequence, as well as concatenate them into words in the case of characters or into sentences in the case of complete words. The return type is a depthai_nodes.Classification message. Unit tests have also been added.

ppocr.PaddleOCRParser utilizes this message for the PaddleOCR model.

aljazkonec1 and others added 5 commits September 10, 2024 12:35
…r characters.

This PR adds a classification_sequence_message that returns a sequence of charecters corresponding to maximum probability in the sequence.
The message has optional parameters to remove duplicates and ignore background class indexes.

In addition this PR also adds a PaddleOCR Parser, which utilizes the classification_sequence message.
@github-actions github-actions bot added messages Changes affecting ml.messages parsers Changes affecting ml.parsers labels Sep 11, 2024
Copy link
Collaborator

@jkbmrz jkbmrz left a comment

Choose a reason for hiding this comment

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

LGTM. I already checked most of this code in #62 and left comments there (which were taken in consideration for this version).

Copy link
Collaborator

@kkeroo kkeroo left a comment

Choose a reason for hiding this comment

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

LGTM, one docstring comment.

Copy link

Test Results

140 tests   140 ✅  1s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 245145a.

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
2302 941 41% 0% 🟢

New Files

File Coverage Status
depthai_nodes/ml/messages/creators/classification_sequence.py 100% 🟢
depthai_nodes/ml/parsers/ppocr.py 26% 🟢
TOTAL 63% 🟢

Modified Files

File Coverage Status
depthai_nodes/ml/messages/classification.py 100% 🟢
depthai_nodes/ml/messages/creators/init.py 100% 🟢
depthai_nodes/ml/parsers/init.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 245145a by action🐍

@aljazkonec1 aljazkonec1 merged commit 8899a79 into dev Sep 11, 2024
6 of 10 checks passed
@aljazkonec1 aljazkonec1 deleted the paddle-ocr-parser branch September 11, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
messages Changes affecting ml.messages parsers Changes affecting ml.parsers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants