torchaug


Nametorchaug JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummaryTorchvision Complementary tool to perform batch and GPU data augmentations.
upload_time2024-08-01 12:29:58
maintainerNone
docs_urlNone
authorNone
requires_python<3.13,>=3.8
licenseNone
keywords computer vision deep learning pytorch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            **Efficient vision data augmentations for CPU/GPU per-sample/batched data.**

***Under active development, subject to API change***

[![PyPI python](https://img.shields.io/pypi/pyversions/torchaug)](https://pypi.org/project/torchaug)
[![PyPI version](https://badge.fury.io/py/torchaug.svg)](https://pypi.org/project/torchaug)
[![documentation](https://img.shields.io/badge/dynamic/json.svg?label=docs&url=https%3A%2F%2Fpypi.org%2Fpypi%2Ftorchaug%2Fjson&query=%24.info.version&colorB=brightgreen)](https://torchaug.readthedocs.io/en/stable/)
[![codecov](https://codecov.io/gh/juliendenize/torchaug/branch/main/graph/badge.svg?token=CA266XDW8D)](https://codecov.io/gh/juliendenize/torchaug)
[![License](https://img.shields.io/badge/license-CeCILL--C-blue.svg)](LICENSE)
<!-- start doc -->

# Torchaug

## Introduction

**Torchaug is a data augmentation library for the Pytorch ecosystem**. It is meant to deal efficiently with tensors that are either on CPU or GPU and either per sample or on batches.

It **enriches [Torchvision (v2)](https://pytorch.org/vision/stable/index.html)** that has been implemented over Pytorch and Pillow to, among other things, perform data augmentations. Because it has been implemented first with per-sample CPU data augmentations in mind, it has several drawbacks to make it efficient:

- For data augmentations on GPU, some *CPU/GPU synchronizations* cannot be avoided.
- For data augmentations applied on batch, the *randomness is sampled for the whole batch* and not each sample.

Torchaug removes these issues and its transforms are meant to be used in place of Torchvision. It is based on the code base of Torchvision and therefore follows the same nomenclature as Torchvision with *functional* augmentations and *transforms* class wrappers. However, **Torchaug does not support transforms on Pillow images**.

More details can be found in the [documentation](https://torchaug.readthedocs.io/en/).


To be sure to retrieve the same data augmentations as Torchvision, **the components are tested to match Torchvision outputs**. We made a speed comparison [here](./docs/source/include/speed_comparison.md).


If you find any unexpected behavior or want to suggest a change please open an issue.

## How to use

1. Install Torchaug.

```bash
pip install torchaug
```

2. Import data augmentations from the `torchaug.transforms` package just as for Torchvision.

```python
from torchaug.transforms import (
    RandomColorJitter,
    RandomGaussianBlur,
    SequentialTransform
)


transform = SequentialTransform([
    RandomColorJitter(...),
    RandomGaussianBlur(...)
])

```

For a complete list of transforms please see the [documentation](https://torchaug.readthedocs.io/en/).

## How to contribute

Feel free to contribute to this library by making issues and/or pull requests. For each feature you implement, add tests to make sure it works. Also, please update the documentation.

## Credits

We would like to thank the authors of Torchvision for generously opening their source code. Portions of Torchaug were originally taken from Torchvision, which is released under the BSD 3-Clause License. Please see their [repository](https://github.com/pytorch/vision/) and their [BSD 3-Clause License](https://github.com/pytorch/vision/blob/main/LICENSE) for more details.

## LICENSE

Torchaug is licensed under the [CeCILL-C license](LICENSE).
<!-- end doc -->

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "torchaug",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.8",
    "maintainer_email": null,
    "keywords": "computer vision, deep learning, pytorch",
    "author": null,
    "author_email": "Julien Denize <julien.denize@cea.fr>",
    "download_url": "https://files.pythonhosted.org/packages/f8/db/a782479c29ecd3c61ab47fbbc6b3f1d00f6dba1c41e887f8620e157ff902/torchaug-0.6.0.tar.gz",
    "platform": null,
    "description": "**Efficient vision data augmentations for CPU/GPU per-sample/batched data.**\n\n***Under active development, subject to API change***\n\n[![PyPI python](https://img.shields.io/pypi/pyversions/torchaug)](https://pypi.org/project/torchaug)\n[![PyPI version](https://badge.fury.io/py/torchaug.svg)](https://pypi.org/project/torchaug)\n[![documentation](https://img.shields.io/badge/dynamic/json.svg?label=docs&url=https%3A%2F%2Fpypi.org%2Fpypi%2Ftorchaug%2Fjson&query=%24.info.version&colorB=brightgreen)](https://torchaug.readthedocs.io/en/stable/)\n[![codecov](https://codecov.io/gh/juliendenize/torchaug/branch/main/graph/badge.svg?token=CA266XDW8D)](https://codecov.io/gh/juliendenize/torchaug)\n[![License](https://img.shields.io/badge/license-CeCILL--C-blue.svg)](LICENSE)\n<!-- start doc -->\n\n# Torchaug\n\n## Introduction\n\n**Torchaug is a data augmentation library for the Pytorch ecosystem**. It is meant to deal efficiently with tensors that are either on CPU or GPU and either per sample or on batches.\n\nIt **enriches [Torchvision (v2)](https://pytorch.org/vision/stable/index.html)** that has been implemented over Pytorch and Pillow to, among other things, perform data augmentations. Because it has been implemented first with per-sample CPU data augmentations in mind, it has several drawbacks to make it efficient:\n\n- For data augmentations on GPU, some *CPU/GPU synchronizations* cannot be avoided.\n- For data augmentations applied on batch, the *randomness is sampled for the whole batch* and not each sample.\n\nTorchaug removes these issues and its transforms are meant to be used in place of Torchvision. It is based on the code base of Torchvision and therefore follows the same nomenclature as Torchvision with *functional* augmentations and *transforms* class wrappers. However, **Torchaug does not support transforms on Pillow images**.\n\nMore details can be found in the [documentation](https://torchaug.readthedocs.io/en/).\n\n\nTo be sure to retrieve the same data augmentations as Torchvision, **the components are tested to match Torchvision outputs**. We made a speed comparison [here](./docs/source/include/speed_comparison.md).\n\n\nIf you find any unexpected behavior or want to suggest a change please open an issue.\n\n## How to use\n\n1. Install Torchaug.\n\n```bash\npip install torchaug\n```\n\n2. Import data augmentations from the `torchaug.transforms` package just as for Torchvision.\n\n```python\nfrom torchaug.transforms import (\n    RandomColorJitter,\n    RandomGaussianBlur,\n    SequentialTransform\n)\n\n\ntransform = SequentialTransform([\n    RandomColorJitter(...),\n    RandomGaussianBlur(...)\n])\n\n```\n\nFor a complete list of transforms please see the [documentation](https://torchaug.readthedocs.io/en/).\n\n## How to contribute\n\nFeel free to contribute to this library by making issues and/or pull requests. For each feature you implement, add tests to make sure it works. Also, please update the documentation.\n\n## Credits\n\nWe would like to thank the authors of Torchvision for generously opening their source code. Portions of Torchaug were originally taken from Torchvision, which is released under the BSD 3-Clause License. Please see their [repository](https://github.com/pytorch/vision/) and their [BSD 3-Clause License](https://github.com/pytorch/vision/blob/main/LICENSE) for more details.\n\n## LICENSE\n\nTorchaug is licensed under the [CeCILL-C license](LICENSE).\n<!-- end doc -->\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Torchvision Complementary tool to perform batch and GPU data augmentations.",
    "version": "0.6.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/juliendenize/torchaug/issues",
        "Download": "https://github.com/juliendenize/torchaug",
        "Homepage": "https://github.com/juliendenize/torchaug",
        "Source Code": "https://github.com/juliendenize/torchaug"
    },
    "split_keywords": [
        "computer vision",
        " deep learning",
        " pytorch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e05e8df29ee4ec09e9f54b3bf5f1a6444e320677e4c59783e537b0bf32bef6a4",
                "md5": "1d506ee23daf906ff47eb0b83e319913",
                "sha256": "33a73df8d5046415c252097cd47e242553b5da7b6b531ae17c00c25b92488e83"
            },
            "downloads": -1,
            "filename": "torchaug-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d506ee23daf906ff47eb0b83e319913",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.8",
            "size": 120775,
            "upload_time": "2024-08-01T12:29:57",
            "upload_time_iso_8601": "2024-08-01T12:29:57.292605Z",
            "url": "https://files.pythonhosted.org/packages/e0/5e/8df29ee4ec09e9f54b3bf5f1a6444e320677e4c59783e537b0bf32bef6a4/torchaug-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8dba782479c29ecd3c61ab47fbbc6b3f1d00f6dba1c41e887f8620e157ff902",
                "md5": "4737800dea530902edba59bc9f16bd26",
                "sha256": "88c59455a12aa71759c24443f23d39568d6cbfdc039152f7dca85d7a22119834"
            },
            "downloads": -1,
            "filename": "torchaug-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4737800dea530902edba59bc9f16bd26",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.8",
            "size": 89898,
            "upload_time": "2024-08-01T12:29:58",
            "upload_time_iso_8601": "2024-08-01T12:29:58.856091Z",
            "url": "https://files.pythonhosted.org/packages/f8/db/a782479c29ecd3c61ab47fbbc6b3f1d00f6dba1c41e887f8620e157ff902/torchaug-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-01 12:29:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "juliendenize",
    "github_project": "torchaug",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "torchaug"
}
        
Elapsed time: 0.64210s