Challenge - 5 Problems
Image Processing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this image processing code?
Consider this Python code that loads an image, converts it to grayscale, and prints the shape of the resulting image array. What will be printed?
Computer Vision
import cv2 image = cv2.imread('sample.jpg') gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) print(gray_image.shape)
Attempts:
2 left
💡 Hint
Grayscale images have only one channel, so the shape has two dimensions.
✗ Incorrect
The cv2.cvtColor function converts the color image to grayscale, resulting in a 2D array with shape (height, width).
❓ Model Choice
intermediate2:00remaining
Which model is best for simple image classification?
You want to classify images of cats and dogs with a small dataset. Which model is the best choice?
Attempts:
2 left
💡 Hint
Using pretrained models helps when data is limited.
✗ Incorrect
Pretrained CNNs with transfer learning leverage learned features and perform well on small datasets.
❓ Hyperparameter
advanced2:00remaining
Which hyperparameter change will most reduce overfitting in image classification?
You trained a CNN that performs well on training images but poorly on new images. Which hyperparameter adjustment will most likely reduce overfitting?
Attempts:
2 left
💡 Hint
Dropout randomly disables neurons during training to prevent memorization.
✗ Incorrect
Adding dropout helps the model generalize better by reducing reliance on specific neurons.
❓ Metrics
advanced2:00remaining
Which metric is best to evaluate image segmentation quality?
You built a model to segment objects in images. Which metric best measures how well the predicted segments match the true segments?
Attempts:
2 left
💡 Hint
This metric compares the overlap between predicted and true segments.
✗ Incorrect
IoU measures the overlap area divided by the union area of predicted and true segments, making it ideal for segmentation.
🔧 Debug
expert2:00remaining
What error does this image processing code raise?
This code tries to resize an image but raises an error. What is the error?
Computer Vision
import cv2 image = cv2.imread('nonexistent.jpg') resized = cv2.resize(image, (100, 100))
Attempts:
2 left
💡 Hint
cv2.imread returns None if the file is missing, causing resize to fail.
✗ Incorrect
cv2.resize fails because the input image is None, triggering an assertion error inside OpenCV.