Skip to main content

Image augmentation library

Project description

Ballfish

Image augmentation library

Installation

pip install ballfish

Documentation

https://ballfish.readthedocs.io/

Example

from ballfish import create_augmentation, Datum
from random import Random

augmentation = create_augmentation(
    [
        # First, augment the quadrangle (quad argument)
        # with geometric transformations
        {
            "name": "rotate",
            "angle_deg": {"name": "uniform", "a": 0, "b": 360},
        },
        # Second, apply the projective transformation to source argument
        # After this step, no more quad transformations make sense
        {"name": "rasterize"},
        # Third, apply raster transformations
        {
            "name": "noise",
            "std": {"name": "truncnorm", "a": 0, "b": 1 / 10},
        },
    ]
)

random = Random(13)
# The source argument must be a `torch.tensor` in (N, C, H, W) format

# The quad argument should be provided in a clockwise order,
# starting from the top-left corner, in (x, y) format.
result = augmentation(Datum(
    source=source, quad=quad, width=64, height=64
), random)

# Transformed image and quads
print(result.quads, result.image)

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

ballfish-0.4.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ballfish-0.4.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file ballfish-0.4.1.tar.gz.

File metadata

  • Download URL: ballfish-0.4.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for ballfish-0.4.1.tar.gz
Algorithm Hash digest
SHA256 dc8ea10ad146a48a13eae2a865e6fc5571d3b35b968e39726342214ddd49dba7
MD5 473b53262409916da826a7a9a84aefa2
BLAKE2b-256 3c514b36395990d9d43d72ff64208a1cccf05168b94d9bc537bc5f483f499f77

See more details on using hashes here.

File details

Details for the file ballfish-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: ballfish-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for ballfish-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ccbb994f960d3b64147653160544448a26258c57a56ca82e3ac7e3554a71a20e
MD5 63f1418e11838baa3ac7a43f23273c01
BLAKE2b-256 bb6667dff227873809cc91899394698508e9845c32e480ff0c3f439cdbc8fca6

See more details on using hashes here.

Supported by

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