You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/use_dataset.mdx
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,9 +177,7 @@ Most image models expect the image to be in the RGB mode. The Beans images are a
177
177
178
178
**3**. Now let's apply data augmentations to your images. 🤗 Datasets works with any augmentation library, and in this example we'll use Albumentations.
179
179
180
-
### Using Albumentations
181
-
182
-
[Albumentations](https://albumentations.ai) is a popular image augmentation library that provides a [rich set of transforms](https://albumentations.ai/docs/reference/supported-targets-by-transform/) including spatial-level transforms, pixel-level transforms, and mixing-level transforms. When running on CPU, which is typical for transformers pipelines, Albumentations is [faster than torchvision](https://albumentations.ai/docs/benchmarks/image-benchmarks/).
180
+
[Albumentations](https://albumentations.ai) is a popular image augmentation library that provides a [rich set of transforms](https://albumentations.ai/docs/reference/supported-targets-by-transform/) including spatial-level transforms, pixel-level transforms, and mixing-level transforms.
183
181
184
182
Install Albumentations:
185
183
@@ -201,7 +199,7 @@ pip install albumentations
201
199
... ])
202
200
```
203
201
204
-
**5**. Since 🤗 Datasets uses PIL images but Albumentations expects OpenCV format (numpy arrays), you need to convert between formats:
202
+
**5**. Since 🤗 Datasets uses PIL images but Albumentations expects NumPy arrays, you need to convert between formats:
205
203
206
204
```py
207
205
>>>defalbumentations_transforms(examples):
@@ -222,16 +220,16 @@ pip install albumentations
222
220
...return examples
223
221
```
224
222
225
-
**6**. Apply the transform using [`~Dataset.set_transform`]:
223
+
**6**. Apply the transform using [`~Dataset.with_transform`]:
0 commit comments