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:
pip install opencv-python albumentations==1.4.13 tqdm numpy
Make sure to install the albumentations v1.4.13.
from tqdm import tqdm
import cv2
import albumentations as A
A
for easier reference. It allows for various image transformations, such as resizing, flipping, and more, with specific focus on maintaining annotation integrity for tasks like object detection.import os
read_label_file
Function