From 0455f35033a3ecd864b8d78b2e20c64dd8005a80 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Thu, 14 Jan 2021 22:55:36 +0000 Subject: [PATCH] Reducing Resolution to 320 and anchor sizes to 8-128. --- ...t_fasterrcnn_mobilenet_v3_large_expect.pkl | Bin 4109 -> 4109 bytes ...sterrcnn_mobilenet_v3_large_fpn_expect.pkl | Bin 4109 -> 4109 bytes torchvision/models/detection/faster_rcnn.py | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/expect/ModelTester.test_fasterrcnn_mobilenet_v3_large_expect.pkl b/test/expect/ModelTester.test_fasterrcnn_mobilenet_v3_large_expect.pkl index 9a9207b73605db38072db7b2a7b5bfaf8a079b65..df07bea5c748b5db23a6aad08507e8ac3fba3e60 100644 GIT binary patch literal 4109 zcmeHKZA?>V6u#xFSZqPGFa?}5RBtwD;)})k& zQ-vyNv%@Wi*gX;@rd2k0YMpLfWxb=Sq1IVl>2cJ#rTWUoES(&hl2Wdv1UJnTH#p=l zg`%@KCDHS)@~2J?FOQ}r_*8g)Jk=3-Rk;kN4=wZd9B@}lcN@t%2PeEzEn1pM^G83SmkiK z<>(sfsOGtgBB^dez(h>2iHxj_9C=!e)>`e6V@s@I))~9x>DKUF@{GMTC~x%0aiwxR zlXu&tdODHU6#1IqhO+ofo|k7TTC-HG1k_60!?cn-^6XOi^#(Dm*s6^@`p~DV)o>i{ z#gm@6L{2~9#HEiLAbPiuDPt!woz4KaSI1X#cy%4Tcpu5UJwgEV)2%WVL^!-Vd)VwAoe^vNb`-*xY$p8hQ;{< zqY~V?;wQ-GJ~&2@f3^JvS$f0>SI@YJ=UFSwH#2?iXNwwdBgjWT$baq!{bN1!uju{4 z@~a9%XuU3idIO^+Oz+O!hXU4rFluD=u|M>u^oM?pfO=RT_0WI8j>vrU-*UB!`SqTQ zV*OSX&SCvzrpD3w63uUA^)=m}3E0n`q&L+3LN)(AHc!mw2fOIJm3;5H1!_DW&>zOp z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L%IU>@`&OFl!E^AEk8f0{=N@)3BJ zkIkFpTL3i8&U{eeoR!aIyw{13n19R<>cjkC9^|~NqIr>ce5>J6j{U%b{sMowUleNmL%${e zB!6p(zs>tCn!hIUC+9s?!!L*G*%91I^$cBmi@$O%(F#5q^9mUFcxPcZTXO8pivF5A z?4`G_GVuAMGo>QmT*?>tT?_q5{k?zT0Dth)40il%4_kb?n)Ij-c%VMuf%%pD2lnU7 z4DYM`A7=etE21FP-+_X+F!s2$=b$E=QDWeZ9CMYId zu_w$}>*#OctVx!iim&5n>)2yXtf%N*YO<$(fy)%0=u0}*Q#78FJvj_hdZIlp)>AZY zIO&lRCQUwt9gf<{`&tC39rgsAeuYhf Ig7tFk-{vS_X8-^I diff --git a/torchvision/models/detection/faster_rcnn.py b/torchvision/models/detection/faster_rcnn.py index 1529298b1bc..5e90dc58763 100644 --- a/torchvision/models/detection/faster_rcnn.py +++ b/torchvision/models/detection/faster_rcnn.py @@ -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. @@ -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), @@ -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. @@ -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),