Manual and repetitive tasks. Ex. One of the things I hate the most, especially if I know that they can be automated. Imagine you need to edit a bunch of images with the same crop and resize operation. For a couple of images, you can just open an image editor and do it by hand. But what about doing the The same operation for thousands or tens of thousands of images.? Let's see how we can automate such image processing task with Piton and OpenCVas well as how we can optimize this data processing process to run efficiently on a sizable data set.
For this post, I created a toy example where I extracted 10,000 frames from a random beach video I recorded, where the goal is crop the image to a square aspect ratio around the center and then resize the image at a fixed size 224×224.
This looks more or less like part of a preprocessing step that might be necessary for a data set when training a machine learning model.