Skip to content

Commit 0455f35

Browse files
committed
Reducing Resolution to 320 and anchor sizes to 8-128.
1 parent 30299cc commit 0455f35

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
Binary file not shown.
Binary file not shown.

torchvision/models/detection/faster_rcnn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,
372372

373373

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

405-
anchor_sizes = ((16, 32, 64, 128, 256), )
405+
anchor_sizes = ((8, 16, 32, 64, 128, ), )
406406
aspect_ratios = ((0.5, 1.0, 2.0), )
407407

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

415415

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

447-
anchor_sizes = ((16, 32, 64, 128, 256, ), ) * 3
447+
anchor_sizes = ((8, 16, 32, 64, 128, ), ) * 3
448448
aspect_ratios = ((0.5, 1.0, 2.0),) * len(anchor_sizes)
449449

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

0 commit comments

Comments
 (0)