So, one of the more common issues we have in Hasty concerns EXIF rotation. Essentially, you look at an image locally - and it looks fine. You upload it to Hasty, and suddenly its orientation is off. What happened?
So to explain why you need to know about EXIF.
EXIF is metadata that is captured by a device. Often for JPG images. What's important here is the metadata for orientation. For example, you might take a photo with your phone. The photo itself has one orientation, but the phone might add an instruction to rotate the phone with 270 degrees.
This is problematic if you are in machine learning. Different tools and frameworks handle EXIF rotation differently. Some ignore it (Hasty, among others). To be on the safe side, we recommend that you convert your images to use the EXIF rotation, then rotate the image to the correct orientation natively, and then remove the EXIF rotation metadata.
This leads to the question: How?
There are many ways to do so, but we recommend JHEAD.
With it, you can easily do this operation through your terminal. Just open it, navigate to the right folder and point it to the right folder like so:
Hello, thank you for using the code provided by Hasty. Please note that some code blocks might not be 100% complete and ready to be run as is. This is done intentionally as we focus on implementing only the most challenging parts that might be tough to pick up from scratch. View our code block as a LEGO block - you can’t use it as a standalone solution, but you can take it and add to your system to complement it. If you have questions about using the tool, please get in touch with us to get direct help from the Hasty team.
jhead -autorot *.jpeg/jpg OR jhead -autorot *
Doing this will rotate the images according to EXIF specifications, and then remove EXIF rotation data. This way, any program, device, or ML model will see the images the same way as you intended.
Hasty is a unified agile ML platform for your entire Vision AI pipeline — with minimal integration effort for you.