Skip to content

Commit ffadf7e

Browse files
YosuaMichaelfacebook-github-bot
authored andcommitted
[fbsync] Add RetinaNet improved weights (#5756)
Summary: * Add RetinaNet improved weights * Add weights. * Change publication date. (Note: this ignores all push blocking failures!) Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095717 fbshipit-source-id: 23d45d8cb487840c5786ae9955e3bbfc37ba5d5b
1 parent 5b5987d commit ffadf7e

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

torchvision/models/detection/retinanet.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -672,17 +672,22 @@ def forward(self, images, targets=None):
672672
return self.eager_outputs(losses, detections)
673673

674674

675+
_COMMON_META = {
676+
"task": "image_object_detection",
677+
"architecture": "RetinaNet",
678+
"categories": _COCO_CATEGORIES,
679+
"interpolation": InterpolationMode.BILINEAR,
680+
}
681+
682+
675683
class RetinaNet_ResNet50_FPN_Weights(WeightsEnum):
676684
COCO_V1 = Weights(
677685
url="https://download.pytorch.org/models/retinanet_resnet50_fpn_coco-eeacb38b.pth",
678686
transforms=ObjectDetection,
679687
meta={
680-
"task": "image_object_detection",
681-
"architecture": "RetinaNet",
688+
**_COMMON_META,
682689
"publication_year": 2017,
683690
"num_params": 34014999,
684-
"categories": _COCO_CATEGORIES,
685-
"interpolation": InterpolationMode.BILINEAR,
686691
"recipe": "https://github.com/pytorch/vision/tree/main/references/detection#retinanet",
687692
"map": 36.4,
688693
},
@@ -691,7 +696,18 @@ class RetinaNet_ResNet50_FPN_Weights(WeightsEnum):
691696

692697

693698
class RetinaNet_ResNet50_FPN_V2_Weights(WeightsEnum):
694-
pass
699+
COCO_V1 = Weights(
700+
url="https://download.pytorch.org/models/retinanet_resnet50_fpn_v2_coco-5905b1c5.pth",
701+
transforms=ObjectDetection,
702+
meta={
703+
**_COMMON_META,
704+
"publication_year": 2019,
705+
"num_params": 38198935,
706+
"recipe": "https://github.com/pytorch/vision/pull/5756",
707+
"map": 41.5,
708+
},
709+
)
710+
DEFAULT = COCO_V1
695711

696712

697713
@handle_legacy_interface(

0 commit comments

Comments
 (0)