Offers a solution for augmenting datasets for YOLOv8 and YOLOv5
Project description
YOLOv5/YOLOv8 Data Augmentation with Albumentations
This GitHub repository offers a solution for augmenting datasets for YOLOv8 and YOLOv5 using the Albumentations library. Albumentations is a Python package designed for image augmentation, providing a simple and flexible approach to perform various image transformations. For more detail you can refer my medium article.
Input
Output
Directories description
- input-ds contain the input of YOLOv8 and YOLOv5 which are following directories.
- Images directory contains the images
- labels directory contains the .txt files. Each .txt file contains the normalized bounding boxes in a following format.
- out-aug-ds contain the augmented output contains following directories.
- Images directory contains the augmented images.
- labels directory contains the augmented labels.
- bb_image This directory contains images with bounding boxes for visualizing the results of augmented data. This is for validation; bounding boxes should be correctly drawn on the objects of interest.
- utils.py: Contains all user-defined helper function.
- main.py: Contains Yolo dataset augmentor pipeline
- CONSTANT.yaml contain following contants need to update on according to your case.
- inp_img_pth for input images path
- inp_lab_pth for input labels path
- out_img_pth for output image path
- out_lab_pth for output labels path
- transformed_file_name: use to name augmented output to differentiate from other input dataset.
- CLASSES: list of input class name according to class number.
Usage
- step to apply augmentation on your own dataset.
- Create Virtual Environment.
- Install requirements using
pip install -r requirements.txt - Provide the input and output path in CONSTANT.yaml file.
- Update the name of transformed_file_name in CONSTANT.yaml otherwise code will overwrite last augmentations.
- Provide the list of name of classes in CONSTANT.yaml in a same sequence as used to assign class numbers in the YOLO dataset labeling.
- For example, if you provided a class list as
['obj1', 'obj2', 'obj3'], the class number used for 'obj1' in the label file should be 0, similarly for 'obj2', the class number should be 1, and so on.
- For example, if you provided a class list as
- Run the pipeline using
python3 run.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yolo-data-augmentor-0.1.tar.gz.
File metadata
- Download URL: yolo-data-augmentor-0.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6894917fb665385f52a2b8fd3e1fafd918d4dafd00872691de865e4582a557aa
|
|
| MD5 |
2c7da4a084e597f7b035af208dff6c6e
|
|
| BLAKE2b-256 |
909f68aa040867e17d1e5e04da90aa2d6d9588b1a5d10cac38a43f86f1a69c89
|
File details
Details for the file yolo_data_augmentor-0.1-py3-none-any.whl.
File metadata
- Download URL: yolo_data_augmentor-0.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65bb4f8ebb7c9b2710dae13e991aacf86122e465f328a8d08020f3498def2e9d
|
|
| MD5 |
8300021bee69816d550abfc05a7fb021
|
|
| BLAKE2b-256 |
d51702b77b61db22eef20bebe138f578306d0cc84a5ad0099685d7d7c765bb91
|