From f965ae76cf6dfe4fd568ed2818f24434c1000888 Mon Sep 17 00:00:00 2001 From: MKhalusova Date: Tue, 3 Jan 2023 09:20:55 -0500 Subject: [PATCH 1/2] Replaced one-letter import --- docs/source/object_detection.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/object_detection.mdx b/docs/source/object_detection.mdx index 14bdc313346..97b600578ba 100644 --- a/docs/source/object_detection.mdx +++ b/docs/source/object_detection.mdx @@ -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) From 28b053b695728d8975c3f37b5ab57cd01d00f267 Mon Sep 17 00:00:00 2001 From: MKhalusova Date: Tue, 3 Jan 2023 09:36:52 -0500 Subject: [PATCH 2/2] more one-letter imports updated --- docs/source/image_classification.mdx | 10 +++++----- docs/source/semantic_segmentation.mdx | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/image_classification.mdx b/docs/source/image_classification.mdx index a4ee939b4fb..e1b3e059266 100644 --- a/docs/source/image_classification.mdx +++ b/docs/source/image_classification.mdx @@ -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), ... ]) ``` diff --git a/docs/source/semantic_segmentation.mdx b/docs/source/semantic_segmentation.mdx index 1499428674c..b7ee935b79a 100644 --- a/docs/source/semantic_segmentation.mdx +++ b/docs/source/semantic_segmentation.mdx @@ -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), ... ] ... ) ```