Challenge - 5 Problems
Image Inpainting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What is the main goal of image inpainting?
Imagine you have a photo with some parts missing or damaged. What does image inpainting try to do with that photo?
Attempts:
2 left
💡 Hint
Think about fixing or restoring parts of an image.
✗ Incorrect
Image inpainting is about filling missing or damaged areas in an image with content that looks natural and consistent with the rest of the image.
❓ Model Choice
intermediate1:30remaining
Which type of model is commonly used for image inpainting?
You want to build a model that fills missing parts of images realistically. Which model type is best suited for this?
Attempts:
2 left
💡 Hint
Think about models good at understanding images and generating pixels.
✗ Incorrect
CNNs with encoder-decoder structures are widely used for image inpainting because they can learn to understand image context and generate missing pixels.
❓ Predict Output
advanced2:00remaining
What is the output shape after inpainting with this PyTorch model?
Given the following PyTorch code snippet for an image inpainting model, what is the shape of the output tensor?
Computer Vision
import torch import torch.nn as nn class SimpleInpaint(nn.Module): def __init__(self): super().__init__() self.encoder = nn.Sequential( nn.Conv2d(3, 64, 3, padding=1), nn.ReLU(), nn.MaxPool2d(2) ) self.decoder = nn.Sequential( nn.ConvTranspose2d(64, 3, 2, stride=2), nn.Sigmoid() ) def forward(self, x): x = self.encoder(x) x = self.decoder(x) return x model = SimpleInpaint() input_tensor = torch.randn(1, 3, 128, 128) output = model(input_tensor) output.shape
Attempts:
2 left
💡 Hint
Check how MaxPool2d and ConvTranspose2d change spatial dimensions.
✗ Incorrect
MaxPool2d with kernel 2 halves the height and width from 128 to 64. ConvTranspose2d with kernel 2 and stride 2 doubles it back to 128. The output channels are 3, matching input channels.
❓ Metrics
advanced1:30remaining
Which metric best measures the quality of image inpainting results?
You want to evaluate how well your inpainting model fills missing parts of images. Which metric is most suitable?
Attempts:
2 left
💡 Hint
Think about metrics that compare images pixel-by-pixel.
✗ Incorrect
PSNR measures the similarity between the original and inpainted images, indicating reconstruction quality. Accuracy and F1 are for classification, not image similarity.
🔧 Debug
expert2:30remaining
Why does this image inpainting model produce blurry results?
You trained a CNN-based image inpainting model, but the filled areas look blurry and lack details. What is the most likely cause?
Attempts:
2 left
💡 Hint
Think about how loss functions affect output sharpness.
✗ Incorrect
Pixel-wise losses like MSE penalize differences equally, leading the model to produce average pixel values in uncertain areas, causing blur. Using adversarial or perceptual losses can improve sharpness.