Hi,
I am using torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True) for object detection. Now this method gives me the scores as one of the outputs. Now i have the co-ordinates of the bounding box, so i want to get the scores based on that image and the bounding box.
For example, i want to do something like this =>
num_classes = 2
in_features = model.roi_heads.box_predictor.cls_score.in_features
model.roi_heads.box_predictor = FastRCNNPredictor(in_features, num_classes)
chkpt_path = "/chkpt_path"
model.load_state_dict(torch.load(chkpt_path))
model.to(device)
images, target = iter(val_data_loaders).next()
images = list(image.to(device, dtype=torch.float) for image in images)
[outputs = model(images)] # replace this with the following
outputs = model(images, precomputed_bbox)
Please suggest me how to do this? I want the score from this