-
-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Some images that contributors send us are not correctly oriented (they may be rotated to the left, to the right or top-down).
Using Google Cloud Vision, we store the orientation of each detected word (up, right, down, left) as a prediction, in the prediction DB table, with the image_orientation type.
prediction.data has the following structure:
{"count":{"up":4,"left":1,"right":18},"rotation":270,"orientation":"right"}
The count field gives you how many words were correctly oriented ("up"), left-oriented ("left"), right-oriented ("right"), or flipped ("down").
The orientation with the highest count determines the values for the remaining fields:
orientationgives you the predicted image orientationrotationgives you the rotation to apply to get a correctly oriented image
We would like to automatically rotate incorrectly-rotated images if we're confident enough that the rotation is incorrect:
- predicted orientation is not
up - fraction of words with the predicted orientation >= 0.95
Steps
- Create a
ImageOrientationImporterclass in importer.py to import them as insights - Add annotator in
annotate.py
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status