-
Notifications
You must be signed in to change notification settings - Fork 463
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
refactor: refactoring rotated boxes #731
Conversation
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.
Thanks for the PR! I added a few comments
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.
Thanks! Minor things to fix and we're good for merge!
@@ -52,6 +53,7 @@ def __init__( | |||
self.doc_builder = DocumentBuilder(export_as_straight_boxes=export_as_straight_boxes) | |||
self.assume_straight_pages = assume_straight_pages | |||
self.straighten_pages = straighten_pages | |||
self.crop_orientation_predictor = crop_orientation_predictor(pretrained=True) |
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.
still missing the .eval()
, let's make sure we have all models in eval mode in a predictor
the .eval() is already applied to the model in the predictor when you instantiate it. The predictor is a predictor object and not a torch model |
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.
Looks good, thanks!
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.
Evaluation CI jobs seem to fail though :/
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.
Thanks so much!!
Hello @charlesmindee |
@Rob192 could you elaborate a bit please? And if there is still a problem on |
This PR deletes function However I agree that we should add more of a functional test that verifies the output of the OCRPredictor, including text box locations. That would ease the release process. I raised the issue #800 |
Currently a draft, not to be reviewed (at least not before #723 is merged)
This PR introduces a new format for rotated boxes:
(x, h, w, h, a) --> [[x1 y1]
[x2 y2]
[x3 y3]
[x4 y4]]
It contains much more information, and allows us to simplify many functions in doctr.
The convention is the following: once the reading direction of the crop is determined, the 4 points are ordered this way in the polygon array: top left, top right, bot right, bot left.
Any feedback is welcome!