This documentation outlines the process for resizing all images in a directory from 1920x1080 resolution to any desired size. 😇

In this example, I’ve used a resolution of 630x340.

The script utilizes Albumentations.ai for both image augmentation and bounding box adjustments.

Below is an explanation of the Python script I’ve created. Feel free to explore the code.

Let's break down the Python script line by line:

1. Installing Necessary Libraries

pip install opencv-python albumentations==1.4.13 tqdm numpy

Make sure to install the albumentations v1.4.13.


2. Importing Necessary Libraries

from tqdm import tqdm
import cv2
import albumentations as A
import os

3. Defining the read_label_file Function