added report

This commit is contained in:
ClF3 2024-11-20 13:30:14 +08:00
parent a484bfa9ad
commit 2e92990035
3 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ class FeatureExtractor(nn.Module):
def __init__(self, reshape_size=224, pooling=False, verbose=False):
super().__init__()
self.mobilenet = models.mobilenet_v2(pretrained=True)
self.mobilenet = models.mobilenet_v2(weights=models.MobileNet_V2_Weights)
self.mobilenet = nn.Sequential(*list(self.mobilenet.children())[:-1]) # Remove the last classifier
# average pooling
@ -131,7 +131,7 @@ class FastRCNN(nn.Module):
# print(feat.shape)
# perform RoI Pool & mean pool
feat=torchvision.ops.roi_pool(feat, torch.cat((proposal_batch_ids.unsqueeze(1), proposals),dim=1), output_size=(self.roi_output_w, self.roi_output_h))
feat=torchvision.ops.roi_pool(feat, torch.cat((proposal_batch_ids.unsqueeze(1), proposals),dim=1), output_size=(self.roi_output_h, self.roi_output_w))
# print(feat.shape)
feat=feat.mean(dim=[2,3])
# print(feat.shape)

BIN
report.pdf Normal file

Binary file not shown.