# 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](https://medium.com/red-buffer/apply-data-augmentation-on-yolov5-yolov8-dataset-958e89d4bc5d).
## Input
![input image](input-ds/images/image_1.jpg)
## Output
![input label](bb_image/image_1_aug_out.png)
## 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.
- Run the pipeline using
```
python3 run.py
```
没有合适的资源?快使用搜索试试~ 我知道了~
yolov8系列--Applied augmentation on yolov5 and yolov8 dataset..zip
共30个文件
png:12个
txt:11个
py:2个
需积分: 5 0 下载量 12 浏览量
2024-02-24
21:45:01
上传
评论
收藏 2.72MB ZIP 举报
温馨提示
yolov8系列--Applied augmentation on yolov5 and yolov8 dataset.
资源推荐
资源详情
资源评论
收起资源包目录
yolov8系列--Applied augmentation on yolov5 and yolov8 dataset..zip (30个子文件)
kwan1120
utils.py 9KB
input-ds
labels
image_4.txt 38B
image_3.txt 38B
image_2.txt 304B
image_1.txt 324B
images
image_4.png 702KB
image_1.jpg 40KB
image_3.png 967KB
image_2.jpg 61KB
main.py 765B
bb_image
image_4_aug_out.png 71KB
image_2_aug_out.png 175KB
image_1_aug_out.png 137KB
image_3_aug_out.png 95KB
contants.yaml 193B
requirements.txt 44B
.gitignore 33B
out-aug-ds
labels
image_2_aug_out.txt 275B
image_3_aug_out.txt 87B
image_1_aug_out.txt 399B
saeed_1_frame_000027_aug_out.txt 77B
image_4_aug_out.txt 75B
pak_vs_wi_p3_frame_000200_aug_out.txt 85B
images
image_4_aug_out.png 70KB
image_2_aug_out.png 176KB
pak_vs_wi_p3_frame_000200_aug_out.png 119KB
image_1_aug_out.png 137KB
image_3_aug_out.png 95KB
saeed_1_frame_000027_aug_out.png 96KB
README.md 3KB
共 30 条
- 1
资源评论
Kwan的解忧杂货铺
- 粉丝: 2w+
- 资源: 3698
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功