Metadata-Version: 2.4
Name: ballfish
Version: 0.4.1
Summary: Image augmentation library
Author-email: Arseniy Terekhin <senyai@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/iitpvisionlab/ballfish
Project-URL: Documentation, https://ballfish.readthedocs.io/
Project-URL: Bug Reports, https://github.com/iitpvisionlab/ballfish/issues
Project-URL: Source, https://github.com/iitpvisionlab/ballfish
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torchvision
Requires-Dist: torch
Requires-Dist: scipy
Dynamic: license-file

## Ballfish

Image augmentation library


### Installation
`pip install ballfish`

### Documentation

https://ballfish.readthedocs.io/

### Example


```python
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)
```
