Skip to content

Commit

Permalink
Reducing Resolution to 320 and anchor sizes to 8-128.
Browse files Browse the repository at this point in the history
  • Loading branch information
datumbox committed Jan 14, 2021
1 parent 30299cc commit 0455f35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions torchvision/models/detection/faster_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,


def fasterrcnn_mobilenet_v3_large(pretrained=False, progress=True, num_classes=91, pretrained_backbone=True,
trainable_backbone_layers=None, min_size=320, max_size=640, **kwargs):
trainable_backbone_layers=None, min_size=320, max_size=320, **kwargs):
"""
Constructs a Faster R-CNN model with a MobileNetV3-Large backbone. It works similarly
to Faster R-CNN with ResNet-50 FPN backbone. See `fasterrcnn_resnet50_fpn` for more details.
Expand Down Expand Up @@ -402,7 +402,7 @@ def fasterrcnn_mobilenet_v3_large(pretrained=False, progress=True, num_classes=9
backbone = mobilenet_backbone("mobilenet_v3_large", pretrained_backbone, False,
trainable_layers=trainable_backbone_layers)

anchor_sizes = ((16, 32, 64, 128, 256), )
anchor_sizes = ((8, 16, 32, 64, 128, ), )
aspect_ratios = ((0.5, 1.0, 2.0), )

model = FasterRCNN(backbone, num_classes, rpn_anchor_generator=AnchorGenerator(anchor_sizes, aspect_ratios),
Expand All @@ -414,7 +414,7 @@ def fasterrcnn_mobilenet_v3_large(pretrained=False, progress=True, num_classes=9


def fasterrcnn_mobilenet_v3_large_fpn(pretrained=False, progress=True, num_classes=91, pretrained_backbone=True,
trainable_backbone_layers=None, min_size=320, max_size=640, **kwargs):
trainable_backbone_layers=None, min_size=320, max_size=320, **kwargs):
"""
Constructs a Faster R-CNN model with a MobileNetV3-Large FPN backbone. It works similarly
to Faster R-CNN with ResNet-50 FPN backbone. See `fasterrcnn_resnet50_fpn` for more details.
Expand Down Expand Up @@ -444,7 +444,7 @@ def fasterrcnn_mobilenet_v3_large_fpn(pretrained=False, progress=True, num_class
backbone = mobilenet_backbone("mobilenet_v3_large", pretrained_backbone, True,
trainable_layers=trainable_backbone_layers)

anchor_sizes = ((16, 32, 64, 128, 256, ), ) * 3
anchor_sizes = ((8, 16, 32, 64, 128, ), ) * 3
aspect_ratios = ((0.5, 1.0, 2.0),) * len(anchor_sizes)

model = FasterRCNN(backbone, num_classes, rpn_anchor_generator=AnchorGenerator(anchor_sizes, aspect_ratios),
Expand Down

0 comments on commit 0455f35

Please sign in to comment.