nrtk-albumentations 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nrtk_albumentations-2.1.0/LICENSE +21 -0
- nrtk_albumentations-2.1.0/PKG-INFO +196 -0
- nrtk_albumentations-2.1.0/README.md +142 -0
- nrtk_albumentations-2.1.0/albumentations/__init__.py +21 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/__init__.py +23 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/blur/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/blur/functional.py +438 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/blur/transforms.py +1633 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/crops/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/crops/functional.py +494 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/crops/transforms.py +3647 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/channel_dropout.py +134 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/coarse_dropout.py +567 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/functional.py +1017 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/grid_dropout.py +166 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/mask_dropout.py +274 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/transforms.py +461 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/dropout/xy_masking.py +186 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/distortion.py +1238 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/flip.py +752 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/functional.py +4151 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/pad.py +676 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/resize.py +956 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/rotate.py +864 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/geometric/transforms.py +1962 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/mixing/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/mixing/domain_adaptation.py +787 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/mixing/domain_adaptation_functional.py +453 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/mixing/functional.py +878 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/mixing/transforms.py +832 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/other/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/other/lambda_transform.py +180 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/other/type_transform.py +261 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/pixel/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/pixel/functional.py +4226 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/pixel/transforms.py +7556 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/spectrogram/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/spectrogram/transform.py +220 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/text/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/text/functional.py +272 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/text/transforms.py +299 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/transforms3d/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/transforms3d/functional.py +393 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/transforms3d/transforms.py +1422 -0
- nrtk_albumentations-2.1.0/albumentations/augmentations/utils.py +249 -0
- nrtk_albumentations-2.1.0/albumentations/core/__init__.py +0 -0
- nrtk_albumentations-2.1.0/albumentations/core/bbox_utils.py +920 -0
- nrtk_albumentations-2.1.0/albumentations/core/composition.py +1885 -0
- nrtk_albumentations-2.1.0/albumentations/core/hub_mixin.py +299 -0
- nrtk_albumentations-2.1.0/albumentations/core/keypoints_utils.py +521 -0
- nrtk_albumentations-2.1.0/albumentations/core/label_manager.py +339 -0
- nrtk_albumentations-2.1.0/albumentations/core/pydantic.py +239 -0
- nrtk_albumentations-2.1.0/albumentations/core/serialization.py +352 -0
- nrtk_albumentations-2.1.0/albumentations/core/transforms_interface.py +976 -0
- nrtk_albumentations-2.1.0/albumentations/core/type_definitions.py +127 -0
- nrtk_albumentations-2.1.0/albumentations/core/utils.py +605 -0
- nrtk_albumentations-2.1.0/albumentations/core/validation.py +129 -0
- nrtk_albumentations-2.1.0/albumentations/pytorch/__init__.py +1 -0
- nrtk_albumentations-2.1.0/albumentations/pytorch/transforms.py +189 -0
- nrtk_albumentations-2.1.0/pyproject.toml +276 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Vladimir Iglovikov, Alexander Buslaev, Alexander Parinov,
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nrtk-albumentations
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: Fork of Albumentations in direct support of NRTK (Natural Robustness Toolkit). Fast, flexible, and advanced augmentation library for deep learning, computer vision, and medical imaging. Offers a wide range of transformations for both 2D (images, masks, bboxes, keypoints) and 3D (volumes, volumetric masks, keypoints) data, with optimized performance and seamless integration into ML workflows.
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: 2D augmentation,3D augmentation,aerial photography,anomaly detection,artificial intelligence,autonomous driving,bounding boxes,classification,computer vision,computer vision library,data augmentation,data preprocessing,data science,deep learning,deep learning library,depth estimation,face recognition,fast augmentation,image augmentation,image processing,image transformation,images,instance segmentation,keras,keypoint detection,keypoints,machine learning,machine learning tools,masks,medical imaging,microscopy,object counting,object detection,optimized performance,panoptic segmentation,pose estimation,python library,pytorch,quality inspection,real-time processing,robotics vision,satellite imagery,semantic segmentation,tensorflow,volumes,volumetric data,volumetric masks
|
|
8
|
+
Author: Vladimir Iglovikov
|
|
9
|
+
Maintainer: Kitware, Inc.
|
|
10
|
+
Maintainer-email: nrtk@kitware.com
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering
|
|
29
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
30
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
31
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
33
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
34
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
35
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
36
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
37
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
38
|
+
Classifier: Typing :: Typed
|
|
39
|
+
Provides-Extra: hub
|
|
40
|
+
Provides-Extra: pytorch
|
|
41
|
+
Provides-Extra: text
|
|
42
|
+
Requires-Dist: PyYAML
|
|
43
|
+
Requires-Dist: albucore (==0.0.28)
|
|
44
|
+
Requires-Dist: eval-type-backport ; python_version < "3.10"
|
|
45
|
+
Requires-Dist: numpy (>=1.24.4)
|
|
46
|
+
Requires-Dist: opencv-python-headless (>=4.9.0.80)
|
|
47
|
+
Requires-Dist: pydantic (>=2.9.2)
|
|
48
|
+
Requires-Dist: scipy (>=1.10.0)
|
|
49
|
+
Requires-Dist: typing-extensions (>=4.9.0) ; python_version < "3.10"
|
|
50
|
+
Project-URL: Homepage, https://nrtk.readthedocs.io/
|
|
51
|
+
Project-URL: Repository, https://github.com/Kitware/nrtk-albumentations
|
|
52
|
+
Description-Content-Type: text/markdown
|
|
53
|
+
|
|
54
|
+
# Albumentations (NRTK Fork)
|
|
55
|
+
|
|
56
|
+
[](https://github.com/Kitware/nrtk-albumentations/actions)
|
|
57
|
+
[](https://opensource.org/licenses/MIT)
|
|
58
|
+
|
|
59
|
+
This is a fork of [Albumentations](https://github.com/albumentations-team/albumentations) maintained by Kitware in direct support of [NRTK (Natural Robustness Toolkit)](https://github.com/Kitware/nrtk).
|
|
60
|
+
|
|
61
|
+
**Fork Information:**
|
|
62
|
+
|
|
63
|
+
- Last upstream version: Albumentations v2.0.8
|
|
64
|
+
- Forked: October 2025
|
|
65
|
+
|
|
66
|
+
## About
|
|
67
|
+
|
|
68
|
+
Albumentations is a Python library for fast and flexible image augmentation. This fork is maintained specifically for integration with NRTK and includes modifications to support NRTK's natural robustness evaluation workflows.
|
|
69
|
+
|
|
70
|
+
Image augmentation is used in deep learning and computer vision tasks to increase the quality of trained models by creating new training samples from existing data through various transformations.
|
|
71
|
+
|
|
72
|
+
## Key Features
|
|
73
|
+
|
|
74
|
+
- **Complete Computer Vision Support**: Works with all major CV tasks including classification, segmentation (semantic & instance), object detection, and pose estimation
|
|
75
|
+
- **Simple, Unified API**: One consistent interface for all data types - RGB/grayscale/multispectral images, masks, bounding boxes, and keypoints
|
|
76
|
+
- **Rich Augmentation Library**: 70+ high-quality augmentations to enhance your training data
|
|
77
|
+
- **Fast**: Optimized for production use with consistently high performance
|
|
78
|
+
- **Deep Learning Integration**: Works with PyTorch, TensorFlow, and other frameworks
|
|
79
|
+
- **3D Support**: Volumetric data transformations for medical imaging and other 3D applications
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
This package is designed to be installed as a dependency of NRTK. For standalone installation, use:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install nrtk-albumentations
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## A Simple Example
|
|
90
|
+
|
|
91
|
+
This package is intended for use with NRTK's [AlbumentationPerturber](https://nrtk.readthedocs.io/en/latest/_implementations/nrtk.impls.perturb_image.generic.albumentations_perturber.AlbumentationsPerturber.html#albumentationsperturber). For direct usage:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import albumentations as A
|
|
95
|
+
import cv2
|
|
96
|
+
|
|
97
|
+
# Declare an augmentation pipeline
|
|
98
|
+
transform = A.Compose([
|
|
99
|
+
A.RandomCrop(width=256, height=256),
|
|
100
|
+
A.HorizontalFlip(p=0.5),
|
|
101
|
+
A.RandomBrightnessContrast(p=0.2),
|
|
102
|
+
])
|
|
103
|
+
|
|
104
|
+
# Read an image with OpenCV and convert it to the RGB colorspace
|
|
105
|
+
image = cv2.imread("image.jpg")
|
|
106
|
+
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
|
107
|
+
|
|
108
|
+
# Augment an image
|
|
109
|
+
transformed = transform(image=image)
|
|
110
|
+
transformed_image = transformed["image"]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Documentation
|
|
114
|
+
|
|
115
|
+
For detailed documentation on available transforms and usage patterns, see:
|
|
116
|
+
|
|
117
|
+
- [Albumentations (NRTK Fork) Documentation](https://nrtk-albumentations.readthedocs.io/)
|
|
118
|
+
- [NRTK Documentation](https://nrtk.readthedocs.io/)
|
|
119
|
+
|
|
120
|
+
## Available Transformations
|
|
121
|
+
|
|
122
|
+
Albumentations provides 70+ transforms across several categories:
|
|
123
|
+
|
|
124
|
+
### Pixel-level Transforms
|
|
125
|
+
|
|
126
|
+
Transforms that modify pixel values without changing image geometry (masks, bboxes, keypoints remain unchanged):
|
|
127
|
+
|
|
128
|
+
- Color adjustments: `RandomBrightnessContrast`, `HueSaturationValue`, `ColorJitter`
|
|
129
|
+
- Noise addition: `GaussNoise`, `ISONoise`, `MultiplicativeNoise`
|
|
130
|
+
- Blur effects: `GaussianBlur`, `MotionBlur`, `MedianBlur`, `Defocus`
|
|
131
|
+
- Compression: `ImageCompression`
|
|
132
|
+
- And many more...
|
|
133
|
+
|
|
134
|
+
### Spatial-level Transforms
|
|
135
|
+
|
|
136
|
+
Transforms that modify image geometry (automatically applied to masks, bboxes, keypoints):
|
|
137
|
+
|
|
138
|
+
- Cropping: `RandomCrop`, `CenterCrop`, `RandomResizedCrop`
|
|
139
|
+
- Flipping: `HorizontalFlip`, `VerticalFlip`
|
|
140
|
+
- Rotation: `Rotate`, `RandomRotate90`, `SafeRotate`
|
|
141
|
+
- Resizing: `Resize`, `LongestMaxSize`, `SmallestMaxSize`
|
|
142
|
+
- Distortions: `ElasticTransform`, `GridDistortion`, `OpticalDistortion`
|
|
143
|
+
- And many more...
|
|
144
|
+
|
|
145
|
+
### 3D Transforms
|
|
146
|
+
|
|
147
|
+
Transforms for volumetric data (medical imaging, etc.):
|
|
148
|
+
|
|
149
|
+
- `RandomCrop3D`, `CenterCrop3D`
|
|
150
|
+
- `Pad3D`, `PadIfNeeded3D`
|
|
151
|
+
- `CoarseDropout3D`
|
|
152
|
+
- `CubicSymmetry`
|
|
153
|
+
|
|
154
|
+
For a complete list with detailed parameters, see the [transform reference](https://nrtk-albumentations.readthedocs.io/).
|
|
155
|
+
|
|
156
|
+
## Maintainer
|
|
157
|
+
|
|
158
|
+
**Kitware, Inc.** <nrtk@kitware.com>
|
|
159
|
+
|
|
160
|
+
## Original Authors
|
|
161
|
+
|
|
162
|
+
This library was originally created by:
|
|
163
|
+
|
|
164
|
+
- Vladimir I. Iglovikov
|
|
165
|
+
- Alexander Buslaev
|
|
166
|
+
- Alex Parinov
|
|
167
|
+
- Eugene Khvedchenya
|
|
168
|
+
- Mikhail Druzhinin
|
|
169
|
+
|
|
170
|
+
## Contributing
|
|
171
|
+
|
|
172
|
+
This fork is maintained specifically for NRTK integration. We are not accepting general contributions at this time. For issues or questions related to NRTK integration, please open an issue on the [NRTK repository](https://github.com/Kitware/nrtk/issues).
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
177
|
+
|
|
178
|
+
## Citation
|
|
179
|
+
|
|
180
|
+
If you use this library in your research, please consider citing the original Albumentations paper:
|
|
181
|
+
|
|
182
|
+
```bibtex
|
|
183
|
+
@Article{info11020125,
|
|
184
|
+
AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
|
|
185
|
+
TITLE = {Albumentations: Fast and Flexible Image Augmentations},
|
|
186
|
+
JOURNAL = {Information},
|
|
187
|
+
VOLUME = {11},
|
|
188
|
+
YEAR = {2020},
|
|
189
|
+
NUMBER = {2},
|
|
190
|
+
ARTICLE-NUMBER = {125},
|
|
191
|
+
URL = {https://www.mdpi.com/2078-2489/11/2/125},
|
|
192
|
+
ISSN = {2078-2489},
|
|
193
|
+
DOI = {10.3390/info11020125}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Albumentations (NRTK Fork)
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Kitware/nrtk-albumentations/actions)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
This is a fork of [Albumentations](https://github.com/albumentations-team/albumentations) maintained by Kitware in direct support of [NRTK (Natural Robustness Toolkit)](https://github.com/Kitware/nrtk).
|
|
7
|
+
|
|
8
|
+
**Fork Information:**
|
|
9
|
+
|
|
10
|
+
- Last upstream version: Albumentations v2.0.8
|
|
11
|
+
- Forked: October 2025
|
|
12
|
+
|
|
13
|
+
## About
|
|
14
|
+
|
|
15
|
+
Albumentations is a Python library for fast and flexible image augmentation. This fork is maintained specifically for integration with NRTK and includes modifications to support NRTK's natural robustness evaluation workflows.
|
|
16
|
+
|
|
17
|
+
Image augmentation is used in deep learning and computer vision tasks to increase the quality of trained models by creating new training samples from existing data through various transformations.
|
|
18
|
+
|
|
19
|
+
## Key Features
|
|
20
|
+
|
|
21
|
+
- **Complete Computer Vision Support**: Works with all major CV tasks including classification, segmentation (semantic & instance), object detection, and pose estimation
|
|
22
|
+
- **Simple, Unified API**: One consistent interface for all data types - RGB/grayscale/multispectral images, masks, bounding boxes, and keypoints
|
|
23
|
+
- **Rich Augmentation Library**: 70+ high-quality augmentations to enhance your training data
|
|
24
|
+
- **Fast**: Optimized for production use with consistently high performance
|
|
25
|
+
- **Deep Learning Integration**: Works with PyTorch, TensorFlow, and other frameworks
|
|
26
|
+
- **3D Support**: Volumetric data transformations for medical imaging and other 3D applications
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
This package is designed to be installed as a dependency of NRTK. For standalone installation, use:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install nrtk-albumentations
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## A Simple Example
|
|
37
|
+
|
|
38
|
+
This package is intended for use with NRTK's [AlbumentationPerturber](https://nrtk.readthedocs.io/en/latest/_implementations/nrtk.impls.perturb_image.generic.albumentations_perturber.AlbumentationsPerturber.html#albumentationsperturber). For direct usage:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import albumentations as A
|
|
42
|
+
import cv2
|
|
43
|
+
|
|
44
|
+
# Declare an augmentation pipeline
|
|
45
|
+
transform = A.Compose([
|
|
46
|
+
A.RandomCrop(width=256, height=256),
|
|
47
|
+
A.HorizontalFlip(p=0.5),
|
|
48
|
+
A.RandomBrightnessContrast(p=0.2),
|
|
49
|
+
])
|
|
50
|
+
|
|
51
|
+
# Read an image with OpenCV and convert it to the RGB colorspace
|
|
52
|
+
image = cv2.imread("image.jpg")
|
|
53
|
+
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
|
54
|
+
|
|
55
|
+
# Augment an image
|
|
56
|
+
transformed = transform(image=image)
|
|
57
|
+
transformed_image = transformed["image"]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
For detailed documentation on available transforms and usage patterns, see:
|
|
63
|
+
|
|
64
|
+
- [Albumentations (NRTK Fork) Documentation](https://nrtk-albumentations.readthedocs.io/)
|
|
65
|
+
- [NRTK Documentation](https://nrtk.readthedocs.io/)
|
|
66
|
+
|
|
67
|
+
## Available Transformations
|
|
68
|
+
|
|
69
|
+
Albumentations provides 70+ transforms across several categories:
|
|
70
|
+
|
|
71
|
+
### Pixel-level Transforms
|
|
72
|
+
|
|
73
|
+
Transforms that modify pixel values without changing image geometry (masks, bboxes, keypoints remain unchanged):
|
|
74
|
+
|
|
75
|
+
- Color adjustments: `RandomBrightnessContrast`, `HueSaturationValue`, `ColorJitter`
|
|
76
|
+
- Noise addition: `GaussNoise`, `ISONoise`, `MultiplicativeNoise`
|
|
77
|
+
- Blur effects: `GaussianBlur`, `MotionBlur`, `MedianBlur`, `Defocus`
|
|
78
|
+
- Compression: `ImageCompression`
|
|
79
|
+
- And many more...
|
|
80
|
+
|
|
81
|
+
### Spatial-level Transforms
|
|
82
|
+
|
|
83
|
+
Transforms that modify image geometry (automatically applied to masks, bboxes, keypoints):
|
|
84
|
+
|
|
85
|
+
- Cropping: `RandomCrop`, `CenterCrop`, `RandomResizedCrop`
|
|
86
|
+
- Flipping: `HorizontalFlip`, `VerticalFlip`
|
|
87
|
+
- Rotation: `Rotate`, `RandomRotate90`, `SafeRotate`
|
|
88
|
+
- Resizing: `Resize`, `LongestMaxSize`, `SmallestMaxSize`
|
|
89
|
+
- Distortions: `ElasticTransform`, `GridDistortion`, `OpticalDistortion`
|
|
90
|
+
- And many more...
|
|
91
|
+
|
|
92
|
+
### 3D Transforms
|
|
93
|
+
|
|
94
|
+
Transforms for volumetric data (medical imaging, etc.):
|
|
95
|
+
|
|
96
|
+
- `RandomCrop3D`, `CenterCrop3D`
|
|
97
|
+
- `Pad3D`, `PadIfNeeded3D`
|
|
98
|
+
- `CoarseDropout3D`
|
|
99
|
+
- `CubicSymmetry`
|
|
100
|
+
|
|
101
|
+
For a complete list with detailed parameters, see the [transform reference](https://nrtk-albumentations.readthedocs.io/).
|
|
102
|
+
|
|
103
|
+
## Maintainer
|
|
104
|
+
|
|
105
|
+
**Kitware, Inc.** <nrtk@kitware.com>
|
|
106
|
+
|
|
107
|
+
## Original Authors
|
|
108
|
+
|
|
109
|
+
This library was originally created by:
|
|
110
|
+
|
|
111
|
+
- Vladimir I. Iglovikov
|
|
112
|
+
- Alexander Buslaev
|
|
113
|
+
- Alex Parinov
|
|
114
|
+
- Eugene Khvedchenya
|
|
115
|
+
- Mikhail Druzhinin
|
|
116
|
+
|
|
117
|
+
## Contributing
|
|
118
|
+
|
|
119
|
+
This fork is maintained specifically for NRTK integration. We are not accepting general contributions at this time. For issues or questions related to NRTK integration, please open an issue on the [NRTK repository](https://github.com/Kitware/nrtk/issues).
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
124
|
+
|
|
125
|
+
## Citation
|
|
126
|
+
|
|
127
|
+
If you use this library in your research, please consider citing the original Albumentations paper:
|
|
128
|
+
|
|
129
|
+
```bibtex
|
|
130
|
+
@Article{info11020125,
|
|
131
|
+
AUTHOR = {Buslaev, Alexander and Iglovikov, Vladimir I. and Khvedchenya, Eugene and Parinov, Alex and Druzhinin, Mikhail and Kalinin, Alexandr A.},
|
|
132
|
+
TITLE = {Albumentations: Fast and Flexible Image Augmentations},
|
|
133
|
+
JOURNAL = {Information},
|
|
134
|
+
VOLUME = {11},
|
|
135
|
+
YEAR = {2020},
|
|
136
|
+
NUMBER = {2},
|
|
137
|
+
ARTICLE-NUMBER = {125},
|
|
138
|
+
URL = {https://www.mdpi.com/2078-2489/11/2/125},
|
|
139
|
+
ISSN = {2078-2489},
|
|
140
|
+
DOI = {10.3390/info11020125}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from importlib.metadata import metadata
|
|
2
|
+
|
|
3
|
+
try:
|
|
4
|
+
_metadata = metadata("albumentations")
|
|
5
|
+
__version__ = _metadata["Version"]
|
|
6
|
+
__author__ = _metadata["Author"]
|
|
7
|
+
__maintainer__ = _metadata["Maintainer"]
|
|
8
|
+
except Exception: # noqa: BLE001
|
|
9
|
+
__version__ = "unknown"
|
|
10
|
+
__author__ = "Vladimir Iglovikov"
|
|
11
|
+
__maintainer__ = "Kitware, Inc."
|
|
12
|
+
|
|
13
|
+
from contextlib import suppress
|
|
14
|
+
|
|
15
|
+
from .augmentations import *
|
|
16
|
+
from .core.composition import *
|
|
17
|
+
from .core.serialization import *
|
|
18
|
+
from .core.transforms_interface import *
|
|
19
|
+
|
|
20
|
+
with suppress(ImportError):
|
|
21
|
+
from .pytorch import *
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .blur.transforms import *
|
|
2
|
+
from .crops.transforms import *
|
|
3
|
+
from .dropout.channel_dropout import *
|
|
4
|
+
from .dropout.coarse_dropout import *
|
|
5
|
+
from .dropout.grid_dropout import *
|
|
6
|
+
from .dropout.mask_dropout import *
|
|
7
|
+
from .dropout.transforms import *
|
|
8
|
+
from .dropout.xy_masking import *
|
|
9
|
+
from .geometric.distortion import *
|
|
10
|
+
from .geometric.flip import *
|
|
11
|
+
from .geometric.pad import *
|
|
12
|
+
from .geometric.resize import *
|
|
13
|
+
from .geometric.rotate import *
|
|
14
|
+
from .geometric.transforms import *
|
|
15
|
+
from .mixing.domain_adaptation import *
|
|
16
|
+
from .mixing.transforms import *
|
|
17
|
+
from .other.lambda_transform import *
|
|
18
|
+
from .other.type_transform import *
|
|
19
|
+
from .pixel.transforms import *
|
|
20
|
+
from .spectrogram.transform import *
|
|
21
|
+
from .text.transforms import *
|
|
22
|
+
from .transforms3d.transforms import *
|
|
23
|
+
from .utils import *
|
|
File without changes
|