Skip to content

Commit

Permalink
Replace one letter import in docs (huggingface#5403)
Browse files Browse the repository at this point in the history
* Replaced one-letter import

* more one-letter imports updated
  • Loading branch information
MKhalusova committed Jan 3, 2023
1 parent 310cddd commit dee3471
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/source/image_classification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ Now apply some augmentations with `albumentations`. You'll randomly crop the ima

```py
>>> import cv2
>>> import albumentations as A
>>> import albumentations
>>> import numpy as np

>>> transform = A.Compose([
... A.RandomCrop(width=256, height=256),
... A.HorizontalFlip(p=0.5),
... A.RandomBrightnessContrast(p=0.2),
>>> transform = albumentations.Compose([
... albumentations.RandomCrop(width=256, height=256),
... albumentations.HorizontalFlip(p=0.5),
... albumentations.RandomBrightnessContrast(p=0.2),
... ])
```

Expand Down
12 changes: 6 additions & 6 deletions docs/source/object_detection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ With `albumentations`, you can apply transforms that will affect the image while
`albumentations` expects the image to be in BGR format, not RGB, so you'll have to convert the image before applying the transform.

```py
>>> import albumentations as A
>>> import albumentations
>>> import numpy as np

>>> transform = A.Compose([
... A.Resize(480, 480),
... A.HorizontalFlip(p=1.0),
... A.RandomBrightnessContrast(p=1.0),
... ], bbox_params=A.BboxParams(format='coco', label_fields=['category']))
>>> transform = albumentations.Compose([
... albumentations.Resize(480, 480),
... albumentations.HorizontalFlip(p=1.0),
... albumentations.RandomBrightnessContrast(p=1.0),
... ], bbox_params=albumentations.BboxParams(format='coco', label_fields=['category']))

>>> # RGB PIL Image -> BGR Numpy array
>>> image = np.flip(np.array(example['image']), -1)
Expand Down
8 changes: 4 additions & 4 deletions docs/source/semantic_segmentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ After defining the color palette, you should be ready to visualize some overlays
Now apply some augmentations with `albumentations`. You’ll first resize the image and adjust its brightness.

```py
>>> import albumentations as A
>>> import albumentations

>>> transform = A.Compose(
>>> transform = albumentations.Compose(
... [
... A.Resize(256, 256),
... A.RandomBrightnessContrast(brightness_limit=0.3, contrast_limit=0.3, p=0.5),
... albumentations.Resize(256, 256),
... albumentations.RandomBrightnessContrast(brightness_limit=0.3, contrast_limit=0.3, p=0.5),
... ]
... )
```
Expand Down

0 comments on commit dee3471

Please sign in to comment.