0
0
Computer Visionml~20 mins

Albumentations library in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Albumentations Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output shape after applying this Albumentations transform?
Given the following Albumentations pipeline applied to a 256x256 RGB image, what will be the shape of the output image?
Computer Vision
import albumentations as A
import numpy as np

transform = A.Compose([
    A.RandomCrop(width=224, height=224),
    A.HorizontalFlip(p=1.0),
])

image = np.zeros((256, 256, 3), dtype=np.uint8)
augmented = transform(image=image)
output = augmented['image'].shape
A(256, 256, 3)
B(224, 224)
C(224, 224, 3)
D(256, 256)
Attempts:
2 left
💡 Hint
RandomCrop changes the image size, HorizontalFlip does not change shape.
Model Choice
intermediate
2:00remaining
Which Albumentations transform is best to increase brightness randomly?
You want to randomly increase or decrease the brightness of images during training. Which Albumentations transform should you use?
AA.RandomBrightnessContrast(brightness_limit=0.2, contrast_limit=0, p=1.0)
BA.HorizontalFlip(p=1.0)
CA.RandomCrop(width=224, height=224)
DA.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))
Attempts:
2 left
💡 Hint
Brightness changes pixel intensity, contrast changes difference between light and dark.
Hyperparameter
advanced
2:00remaining
What is the effect of setting p=0.5 in an Albumentations transform?
In Albumentations, what does setting the parameter p=0.5 for a transform do during augmentation?
AThe transform is applied twice to each image.
BThe transform is applied to all images but with half intensity.
CThe transform is applied only if the image size is greater than 50%.
DThe transform is applied to 50% of the images randomly.
Attempts:
2 left
💡 Hint
p controls the probability of applying the transform.
🔧 Debug
advanced
2:00remaining
Why does this Albumentations pipeline raise an error?
Consider this Albumentations pipeline: transform = A.Compose([ A.RandomCrop(width=300, height=300), A.HorizontalFlip(p=0.5), ]) image = np.zeros((256, 256, 3), dtype=np.uint8) augmented = transform(image=image) Why does this code raise an error?
ARandomCrop size is larger than the input image size, causing an error.
BHorizontalFlip requires p=1.0 to work correctly.
CCompose requires at least three transforms.
DThe image array must be float32, not uint8.
Attempts:
2 left
💡 Hint
RandomCrop cannot crop bigger than the image.
🧠 Conceptual
expert
3:00remaining
Which Albumentations transform is best for simulating motion blur in images?
You want to simulate motion blur effects on images to make your model robust to camera movement. Which Albumentations transform should you use?
AA.GaussianBlur(blur_limit=7, p=1.0)
BA.MotionBlur(blur_limit=7, p=1.0)
CA.RandomBrightnessContrast(p=1.0)
DA.HorizontalFlip(p=1.0)
Attempts:
2 left
💡 Hint
Motion blur simulates streaks caused by movement.