Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ilirosmanaj/detect_kermit/llms.txt
Use this file to discover all available pages before exploring further.
rotate_images.py is a data augmentation helper that effectively triples the training set by creating three rotated variants of each Kermit training image — rotated 90° clockwise (right), 90° counter-clockwise (left), and 180°. Running this script before training gives the model a much wider variety of image orientations to learn from without requiring any additional raw footage.
Source code
helpers/rotate_images.py
How to use
Run the script from thehelpers/ directory:
Output naming
The rotated copies are saved alongside the originals insidePATH_TO_IMAGES. The direction string is appended directly to the base filename. For example, an original file named movie1frame100.jpg produces three new files:
| File | Rotation |
|---|---|
movie1frame100right.jpg | 90° clockwise |
movie1frame100left.jpg | 90° counter-clockwise |
movie1frame100None.jpg | 180° |
None suffix on the 180° file comes from calling rotate_image(image) without a direction argument, which leaves the parameter as None — Python’s string formatting then renders it literally as None.
Configuration
The constant at the top of the script controls which directory is scanned and written to:helpers/ directory from which the script is run.
print_progress is imported from helpers/utils.py. It writes an in-place percentage to stdout using \r carriage returns. See the API reference for utils.py for details.