Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the Albumentations library.
Computer Vision
import [1] as A
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing 'cv2' instead of 'albumentations'.
Using 'torch' which is for deep learning, not augmentations.
✗ Incorrect
The Albumentations library is imported using 'import albumentations as A'.
2fill in blank
mediumComplete the code to create a horizontal flip augmentation with a 50% chance.
Computer Vision
transform = A.[1](p=0.5)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using VerticalFlip which flips images top to bottom.
Using Rotate which rotates images instead of flipping.
✗ Incorrect
HorizontalFlip is the correct augmentation to flip images horizontally with probability p=0.5.
3fill in blank
hardFix the error in the code to apply a random brightness and contrast adjustment.
Computer Vision
transform = A.[1](brightness_limit=0.2, contrast_limit=0.2, p=0.5)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using RandomBrightness or RandomContrast alone which only adjust one property.
Using a non-existent class 'BrightnessContrast'.
✗ Incorrect
RandomBrightnessContrast is the correct class to adjust brightness and contrast randomly.
4fill in blank
hardFill both blanks to create a Compose pipeline with horizontal flip and random rotate.
Computer Vision
transform = A.Compose([
A.[1](p=0.5),
A.[2](limit=40, p=0.7)
]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using VerticalFlip instead of HorizontalFlip for horizontal flipping.
Using RandomRotate90 which rotates only by 90 degrees multiples.
✗ Incorrect
HorizontalFlip and Rotate are used to flip images horizontally and rotate them randomly within a limit.
5fill in blank
hardFill all three blanks to create a Compose pipeline with normalization, horizontal flip, and random brightness/contrast.
Computer Vision
transform = A.Compose([
A.[1](mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
A.[2](p=0.5),
A.[3](brightness_limit=0.2, contrast_limit=0.2, p=0.3)
]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Resize instead of Normalize for normalization.
Mixing up the order of augmentations.
✗ Incorrect
Normalize standardizes image colors, HorizontalFlip flips images, and RandomBrightnessContrast adjusts brightness and contrast randomly.