Skip to main content

Simple elastic augmentation for ND arrays.

Project description

augment

A simple elastic augmentation for ND arrays.

Installation

pip install augment-nd

Usage

import augment
import numpy as np
import math

# create some example data
image = np.zeros((100,500,500), dtype=np.float)
image[:] = 0.5
image[:,:10,:] = 0.75
image[:10,:10,:10] = 1
image[:,::10,:] = 1
image[:,:,::10] = 1

transformation = augment.create_identity_transformation(image.shape)

# jitter in 3D
transformation += augment.create_elastic_transformation(
        image.shape,
        num_control_points = [3,10,10],
        jitter_sigma = [0.3, 10, 10])

# rotate around z axis
transformation += augment.create_rotation_transformation(
        image.shape,
        math.pi/4)

# apply transformation
image = augment.apply_transformation(image, transformation)

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

augment-nd-0.1.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

augment_nd-0.1.3-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file augment-nd-0.1.3.tar.gz.

File metadata

  • Download URL: augment-nd-0.1.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for augment-nd-0.1.3.tar.gz
Algorithm Hash digest
SHA256 198ea2d9d95fbed0a7763c30e7ad098a82be906ab97902f863253d94f01c2da5
MD5 2fcff3070044356c1489532c44ede443
BLAKE2b-256 87f35afbd693e79c2c714e44f833f7f453d5ce797b7f439389596fb86ff4bad9

See more details on using hashes here.

File details

Details for the file augment_nd-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: augment_nd-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for augment_nd-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 871e5bcd19ef0366977e9fe66c392fb6a9cf914850c858360ac9db72650aa70d
MD5 4bab7aee579914f017cb17d67f299f58
BLAKE2b-256 2d1b0a42b6c1a2e88196aea003162149220c546f301611a462a0d86ebb92590c

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