Git Product home page Git Product logo

data-augmentation's Introduction

Here I showed augmentation of images with and without bounding boxes using PyTorch, Tensorflow, Albumentations and Imgaug.

Enjoy !

You can find bbox augmentation outputs in imgaug and albumentations folders. I looked bbox augmentation on tensorflow and PyTorch but I couldn't find any. May be there is not but I am not sure. I think someone who wants to create CV models should use PyTorch+Albumentations. Also, I have to say that you shouldn't use that much of augmentation. I set the probabilities of augmentations relatively high because of the visualization purpose of this repo. If you use that much augmentation your model will converge very slow. Furthermore, I am not sure if it will become more robust or worser. ** Augmentation is a very effective method to make your method more robust. As a matter of fact if you try to create models that Works quite well you should consider to use data augmentation.

First install all of the requirements.



pip install -r requirements.txt


"Any fool can know. The point is to understand." Albert Einstein



Using imgaug

Actually top left one the original one but I set titles of all images according to their augmentation. I automated the process and I told myself if I set probability 0 for fliplr it will return original image. Sorry I am too lazy to code if else for naming.

Rotate

Using imgaug 2

Same code but different output because of the probabilities.

Channel Shuff

Original Images

Tensorflow

Using Tensorflow

Tensorflow has tf.image function that can be used for augmentations.

Tensorflow

Using Tensorflow (2)

On training you can consider these images as epochs. As you can see, although you have same original image you will end up with completely different images.

Tensorflow 2

Using PyTorch

On training you can consider these images as epochs. As you can see, although you have same original image you will end up with completely different images.

PyTorch

Using PyTorch (2)

PyTorch2

Using Albumentations -- I think the best one especially when you work on object detection task.

You can add augmentation to your pipeline easily with albumentations. Actually I decided to write new library because of not-adequate built-in functions for bbox augmentation before I met albumentations. You can use it in dataloader of PyTorch, in generators of Tensorflow and also can combine with other augmentations from other frameworks. Thanks albumentations you nailed it !

Albumentations

Using Albumentations (2)

Albumentations

data-augmentation's People

Contributors

abdullahbas avatar

Stargazers

 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.