Git Product home page Git Product logo

data-augmentation's Introduction

Expand your Dataset to infinite!

One of the most common issues that data scientists are faced with in real AI and Computer Vision projects is data insufficiency. Deep Learning algorithms usually need a lot of data to solve our problem and data gathering is expensive, time-consuming, and in some cases impossible, therefore, data augmentation is an important task to generate massive data from a small dataset In this project, you can apply many augmentation methods to your data to generate a massive and sufficient dataset from your small one.

Built With

  • PyTorch
  • Albumentation

About Project

Data augmentation is a simple but important stage in data preparation. In many real AI projects, its so hard to gather enough data to train DL algorithms. So this is where data augmentation helps us to generate new data based on a few samples that we have. You can label your data using annotation softwares and leave the rest to pytorch and albumentations

alt text

How does this project help you?

We designed it to performing image augmentation for:

  • Normal Classification
  • Object Detection
  • Semantic Segmentation (soon)
  • Keypoint Detection (soon)

For different backbones witht different input size you can set the output size according to your desired architecture

cfg = {
    'format': 'yolo',
    'target_size': (640, 640),
    'bounding_box': [
        A.CenterCrop(100, 100),
        A.RandomCrop(100, 100),
        CustomTransform(F.adjust_brightness, 3.0),
        CustomTransform(F.adjust_contrast, 4.2),
        CustomTransform(F.adjust_sharpness, 3.0),
        transforms.Grayscale(),
        CustomTransform(my_f.adjust_saturation, 8),
        CustomTransform(F.adjust_hue, -0.3),
        CustomGaussianBlurTransform(None, 5),
    ],
    'inner_bounding_box': [
        transforms.RandomEqualize(1.0),
        CustomTransform(F.adjust_brightness, 3.0),
        CustomTransform(F.adjust_contrast, 4.2),
        CustomTransform(F.adjust_sharpness, 3.0),
        transforms.Grayscale(),
        CustomTransform(my_f.adjust_saturation, 8),
        CustomTransform(F.adjust_hue, -0.3),
        CustomGaussianBlurTransform(None, 5),
    ]
}

For object detection tasks with bounding boxes, you can perform both bounding-box and inner-bounding-box augmentation If you want to add spatial-level augmentation like crop, rotate, padding or flip, you must add it through Albumentation and pass the bboxes and formats to it Also you can convert Pascal-VOC format to your ideal format like YOLO and COCO using convert functions implemented in utils.py

import albumentations as A

t = A.Compose([
        augmentation,
        A.Resize(width, height)
    ],
    bbox_params=A.BboxParams(format=self.format)) #for example yolo

In case of using torchvision functional transforms, you must create a CustomTransform instance and pass that functional transformer to it. (Implemented in detail in custom_functional_transformers)

Some Interesting Results !

alt text

Contact

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

data-augmentation's People

Contributors

pr1266 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.