Skip to main content

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)

Metadata

Release files for ballfish 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ballfish 0.4.1
File Size Uploaded
ballfish-0.4.1.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ballfish 0.4.1
File Interpreter ABI Platform
ballfish-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.8 kB

Release files / ballfish-0.4.1.tar.gz

Download URL ballfish-0.4.1.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dc8ea10ad146a48a13eae2a865e6fc5571d3b35b968e39726342214ddd49dba7
BLAKE2b-256 checksum
How to use checksums
3c514b36395990d9d43d72ff64208a1cccf05168b94d9bc537bc5f483f499f77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / ballfish-0.4.1-py3-none-any.whl

Download URL ballfish-0.4.1-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccbb994f960d3b64147653160544448a26258c57a56ca82e3ac7e3554a71a20e
BLAKE2b-256 checksum
How to use checksums
bb6667dff227873809cc91899394698508e9845c32e480ff0c3f439cdbc8fca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page