Giter Site home page Giter Site logo

py-data-augmentation's Introduction

py-data-augmentation

Image data augmentation for learning algorithm. This repo is highly based on takmin's c++ version.

Installation Dependencies:

  • Python 2.7
  • numpy
  • scikit-image

You can install with pip or just clone the repo:

pip install pydaag

How to use:

Your input images should be a numpy arrary with shape (img_numbers, img_rows, img_cols, img_channels).

If input images are grayscale, then the shape should be (img_numbers, img_rows, img_cols).

Simple example:

from pydaag import pydaag

#######################################################################
#inputs:
#	images: input images
#	x_slide: Maximum slide in X direction, it's ratio of width of image.
#	y_slide: Maximum slide in Y direction, it's ratio of height of image.
#	z_rotateion: Maximum rotation around Z axis.
#	y_rotateion: Maximum rotation around Y axis.
#	x_rotateion: Maximum rotation around X axis.
#	blur_max_sigma: Maximum standard deviation of Gaussian blur.
#	noise_max_sigma: Maximum standard deviation of Gaussian noise
#######################################################################
images_ = pydaag.data_augmentation(images, x_slide=0.2, y_slide=0.2, 
                                   z_rotation=20, y_rotation=20, x_rotation=20, 
                                   blur_max_sigma=3, noise_max_sigma=20)

You can find an example in test\test.py.

Run the test file:

git clone https://github.com/taoyizhi68/py-data-augmentation.git
cd py-data-augmentation\test
python test.py

inputs:

outputs:

py-data-augmentation's People

Contributors

taoyizhi68 avatar tharuniitk 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.