-
Notifications
You must be signed in to change notification settings - Fork 0
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
PaddleOCR Parser and message #62
Conversation
…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.
Test Results110 tests 110 ✅ 1s ⏱️ Results for commit d4cea65. |
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
): | ||
"""Initializes the PaddleOCR Parser node. | ||
|
||
@param classes: List of class names to be |
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.
some descriptions are missing here
self.out = self.createOutput() | ||
self.input = self.createInput() | ||
self.remove_duplicates = remove_duplicates | ||
self.ignored_indexes = [0] if ignored_indexes is None else ignored_indexes |
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 would be more clean to set the default ignored_indexes
to [0]
instead of None
def setRemoveDuplicates(self, remove_duplicates: bool): | ||
"""Sets the remove_duplicates flag for the classification sequence model. | ||
|
||
@param remove_duplicates: If True, removes consecutive duplicates from the |
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.
@type is missing in the docstring (also below)
from .. import Classifications | ||
|
||
|
||
def create_classification_sequence_message( |
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.
I'm not sure this needs a separate creator function. Could we adjust the create_classification_message
to also support the new features (remove_duplicates
and ignored_indexes
)?
@type classes: List | ||
@param scores: A numpy array of shape (sequence_length, n_classes) containing the (row-wise) probability distributions over the classes. | ||
@type scores: np.ndarray | ||
@param remove_duplicates: If True, removes consecutive duplicates from the sequence. |
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.
Maybe explain this duplicate removal better as it not really clear what is removed and why
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.