0
0
Computer Visionml~20 mins

Image inpainting concept in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Image Inpainting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1: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?
ADetect objects in the photo and label them.
BIncrease the resolution of the entire photo to make it clearer.
CChange the colors of the photo to make it look artistic.
DFill in the missing or damaged parts with plausible content that matches the surrounding area.
Attempts:
2 left
💡 Hint
Think about fixing or restoring parts of an image.
Model Choice
intermediate
1: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?
AConvolutional Neural Network (CNN) with encoder-decoder architecture
BRecurrent Neural Network (RNN) for sequence prediction
CSupport Vector Machine (SVM) for classification
DK-Nearest Neighbors (KNN) for clustering
Attempts:
2 left
💡 Hint
Think about models good at understanding images and generating pixels.
Predict Output
advanced
2: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
Atorch.Size([1, 3, 128, 128])
Btorch.Size([1, 64, 64, 64])
Ctorch.Size([1, 3, 64, 64])
Dtorch.Size([1, 64, 128, 128])
Attempts:
2 left
💡 Hint
Check how MaxPool2d and ConvTranspose2d change spatial dimensions.
Metrics
advanced
1: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?
AF1 Score
BPeak Signal-to-Noise Ratio (PSNR)
CMean Squared Error (MSE) on class labels
DAccuracy
Attempts:
2 left
💡 Hint
Think about metrics that compare images pixel-by-pixel.
🔧 Debug
expert
2: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?
AThe input images were too large, causing memory overflow.
BThe model uses too many convolutional layers, causing overfitting.
CThe model was trained using only pixel-wise loss like Mean Squared Error, which encourages averaging and smooth outputs.
DThe model uses batch normalization, which reduces sharpness.
Attempts:
2 left
💡 Hint
Think about how loss functions affect output sharpness.