0
0
Computer Visionml~10 mins

R-CNN family overview 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 R-CNN model from torchvision.

Computer Vision
from torchvision.models.detection import [1]
Drag options to blanks, or click blank then click option'
Afasterrcnn_resnet50_fpn
Bmaskrcnn_resnet50_fpn
Cresnet50
Dretinanet_resnet50_fpn
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Mask R-CNN or RetinaNet instead of Faster R-CNN.
Importing a backbone model like resnet50 instead of the detection model.
2fill in blank
medium

Complete the code to create a Faster R-CNN model pre-trained on COCO dataset.

Computer Vision
model = [1](pretrained=True)
Drag options to blanks, or click blank then click option'
Afasterrcnn_resnet50_fpn
Bretinanet_resnet50_fpn
Cmaskrcnn_resnet50_fpn
Dssd300_vgg16
Attempts:
3 left
💡 Hint
Common Mistakes
Using Mask R-CNN or RetinaNet functions instead.
Forgetting to set pretrained=True.
3fill in blank
hard

Fix the error in the code to get the number of classes for the Faster R-CNN model.

Computer Vision
num_classes = model.roi_heads.box_predictor.[1]
Drag options to blanks, or click blank then click option'
Apredictor
Bcls_score
Cscore
Dnum_classes
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cls_score' which is a layer, not the number of classes.
Using 'predictor' which is a module, not a number.
4fill in blank
hard

Fill both blanks to replace the Faster R-CNN box predictor with a new one for a custom number of classes.

Computer Vision
in_features = model.roi_heads.box_predictor.[1]
model.roi_heads.box_predictor = FastRCNNPredictor(in_features, [2])
Drag options to blanks, or click blank then click option'
Acls_score.in_features
Bnum_classes
C5
Dcls_score
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'num_classes' instead of 'cls_score.in_features' for the first blank.
Putting the attribute 'num_classes' in the second blank instead of an integer.
5fill in blank
hard

Fill all three blanks to create a Mask R-CNN model with a ResNet-50 backbone and set it to evaluation mode.

Computer Vision
from torchvision.models.detection import [1]
model = [2](pretrained=True)
model.[3]()
Drag options to blanks, or click blank then click option'
Amaskrcnn_resnet50_fpn
Ceval
Dtrain
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'train()' instead of 'eval()' to set the model mode.
Importing Faster R-CNN instead of Mask R-CNN.