0
0
Computer Visionml~10 mins

Data augmentation importance in Computer Vision - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the library used for image data augmentation in Keras.

Computer Vision
from tensorflow.keras.preprocessing.image import [1]
Drag options to blanks, or click blank then click option'
AImageTransformer
BImageAugmentor
CImageDataGenerator
DImageLoader
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent class like ImageAugmentor.
Confusing with image loading classes.
2fill in blank
medium

Complete the code to create an ImageDataGenerator that applies horizontal flips to images.

Computer Vision
datagen = ImageDataGenerator([1]=True)
Drag options to blanks, or click blank then click option'
Ahorizontal_flip
Bvertical_flip
Crotation_range
Dzoom_range
Attempts:
3 left
💡 Hint
Common Mistakes
Using vertical_flip instead of horizontal_flip.
Confusing with rotation or zoom parameters.
3fill in blank
hard

Fix the error in the code to correctly apply data augmentation to the training images.

Computer Vision
train_generator = datagen.flow_from_directory(
    'train_data',
    target_size=(150, 150),
    batch_size=32,
    class_mode=[1]
)
Drag options to blanks, or click blank then click option'
Anone
Bsparse
Cbinary
Dcategorical
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'binary' for multi-class problems.
Using 'none' which disables labels.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps image filenames to their augmented versions using the datagen.

Computer Vision
augmented_images = {img: datagen.[1](img) for img in images if img.[2]('.jpg')}
Drag options to blanks, or click blank then click option'
Aflow
Bendswith
Cstartswith
Dfit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fit' instead of 'flow' to generate images.
Using 'startswith' instead of 'endswith' for file extension check.
5fill in blank
hard

Fill all three blanks to complete the code that applies rotation and zoom augmentation, then fits the generator to training images.

Computer Vision
datagen = ImageDataGenerator(
    rotation_range=[1],
    zoom_range=[2]
)
datagen.[3](train_images)
Drag options to blanks, or click blank then click option'
A20
B0.15
Cfit
Dflow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'flow' instead of 'fit' to prepare the generator.
Confusing rotation_range with zoom_range values.