Recall & Review
beginner
What is a custom detection dataset in PyTorch?
A custom detection dataset is a user-defined dataset class that loads images and their bounding box annotations for object detection tasks, allowing PyTorch models to train on data not included in standard datasets.Click to reveal answer
beginner
Which PyTorch class do you typically extend to create a custom detection dataset?You extend the torch.utils.data.Dataset class to create a custom detection dataset, implementing __len__ and __getitem__ methods.Click to reveal answer
intermediate
What should the __getitem__ method return in a custom detection dataset for object detection?
It should return a tuple: (image_tensor, target), where target is a dictionary containing keys like 'boxes' (bounding boxes), 'labels' (class labels), and optionally 'masks' or 'area'.Click to reveal answer
beginner
Why do bounding boxes in detection datasets use tensors of shape [N, 4]?
Because each bounding box is represented by 4 numbers (xmin, ymin, xmax, ymax), and N is the number of objects in the image, so the tensor shape is [N, 4].
Click to reveal answer
intermediate
How can you apply transformations to images and targets in a custom detection dataset?
You can pass a transform function to the dataset class and apply it inside __getitem__ to both the image and the target dictionary, ensuring consistent augmentation.Click to reveal answer
What method must be implemented when creating a custom PyTorch dataset?
✗ Incorrect
Both __getitem__ and __len__ must be implemented to define how to get an item and the dataset size.
In object detection datasets, what does the 'labels' key in the target dictionary represent?
✗ Incorrect
'labels' contains the class IDs for each object in the image.
Which of these is NOT typically part of the target dictionary in detection datasets?
✗ Incorrect
'image size' is usually not included in the target dictionary.
What shape does the bounding boxes tensor usually have?
✗ Incorrect
Bounding boxes tensor shape is [N, 4], where N is number of boxes.
Why is it important to apply the same transform to both image and target?
✗ Incorrect
Applying the same transform keeps bounding boxes aligned with the image.
Describe how to create a custom detection dataset class in PyTorch.
Think about what data the model needs and how to provide it.
You got /4 concepts.
Explain the structure and contents of the target dictionary in a detection dataset.
Focus on what information describes each object.
You got /4 concepts.