Skip to main content

Image augmentation library

Project description

Image augmentation library

This image augmentation library can be used to crop, flip, blur, sharpen, mix channels, overlay images. The main idea is to use only numpy library to perform these tasks. Augmented images can be used for Machine Learning projects

Getting it

To download augmentation_lib, either fork this github repo or simply use Pypi via pip.

$ pip install augmentation-lib

Features

This library performs different types of augmentation.

Crops:

center_crop_px takes an image, width and height in pixels and returns center cropped image.

center_crop_percents takes an image and size in percents (0 - 1) and returns center cropped image.

crop_px takes an image starting point for cropping, width and height in pixels and returns cropped image.

crop_percents takes an image starting point (height_coordinate, width_coordinate) in px, and size (height, width) in percents for cropping.

random_crop_px takes a cropping size in pixels and randomly crops an image.

random_crop_percents takes a cropping size in percents (0 - 1) and randomly crops an image.

Flips:

flip_horizontal takes an image and flips it horizontally.

flip_vertical takes an image and flips it vertically.

Padding:

zero_pad takes an image and pads it with zeros by specified number of pixels.

Convolution:

conv_one_step performs convolution for specified slice.

convolution_one_layer performs one image layer convolution.

full_convolution performs image convolution by specified kernel.

Dropouts:

dropout_random performs random dropout of image pixels.

dropout performs dropout of image pixels by specified intensity in percents (0 - 1).

Other augmentation:

shuffle performs shuffle of image layers by specified order.

jitter performs color jitter of one specified or random image layer. One of the color channels of the image is modified adding or subtracting a random and bounded value.

opacity makes an image transparent.

opacity_object makes an image background transparent, works better with object images.

overlay2_images overlay 2 images with applied transparency.

resize_np resize image using numpy and Nearest Neighbor Interpolation.

Showcase

More info about using this library you can find in: https://github.com/laume/augmentation_lib/blob/master/augmentation_lib/showcase.ipynb

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

augmentation_lib-0.0.4.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file augmentation_lib-0.0.4.tar.gz.

File metadata

  • Download URL: augmentation_lib-0.0.4.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.0

File hashes

Hashes for augmentation_lib-0.0.4.tar.gz
Algorithm Hash digest
SHA256 3b7bd39c82a2ef962e88dc8dcce318623a6261d227130edc295c9443632c1415
MD5 cf6fac7636eb64ca38e0f8e927bfe2ec
BLAKE2b-256 95c0ef326799f792c46ea044b4161d4149e9142e455b8b7f8effd26f6609bcea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page