label_processing.label_rotation
Label Rotation Module (TensorFlow)
Predicts and corrects the orientation of label images using a trained TensorFlow classification model that outputs one of four angle classes (0°, 90°, 180°, 270°). Used by the traditional pipeline; the Gemini pipeline determines rotation angles via the Gemini API instead.
Functions
|
Copy images into angle-named subdirectories for visual debugging. |
|
Get a list of image paths in the input directory. |
|
Predict angles for a list of images using a trained model. |
|
Load an image from a file path. |
|
Load images from a list of image paths. |
|
Load a trained model, predict angles for input images, and rotate images accordingly. |
|
Rotate an image based on a given angle. |
|
Rotate an image using PIL and save the result. |
|
Rotate images based on their predicted angles and save them to the output directory. |
|
Rotate a single image based on a given angle and save the rotated image. |
|
Save an image to a file path. |