Giter Site home page Giter Site logo

yolo-data-augmentation's Introduction

Apply data augmentation on YOLOv5 or YOLOv8 dataset using Albumentations Library

Albumentations is a Python library for image augmentation that offers a simple and flexible way to perform a variety of image transformations.

Input

input image

Output

input label

Output Visualization

input label

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.
  • controller contain following scripts.
    • apply_album_aug.py contain the augmentated operations.
    • validate_results.py draw the augmented labels on augmented image to visualize the results.
    • album_to_yolo_bb.py is used to convert to labels in albumentation format to yolo format
    • get_album_bb.py is used to get labels in albumentation format from input yolo format.
    • workflow.py contain the pipeline to get the desired results.
    • save_augs.py to save the augmented results.
  • 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.
    • 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 classes in CONSTANT.yaml in a sequence as use to assign class number in yolo dataset labelling.
      • For example, you provided class list is ['obj1', 'obj2', 'obj3'] class number used for obj1 in label file should be 0, similarly for 'obj2' class number should be 1 and so on.
    • run the pipeline using python3 run.py

yolo-data-augmentation's People

Contributors

dpservis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.