17
17
__all__ = ['ssdlite320_mobilenet_v3_large' ]
18
18
19
19
model_urls = {
20
- 'ssd320_mobilenet_v3_large_coco' : None # TODO: add weights
20
+ 'ssdlite320_mobilenet_v3_large_coco' :
21
+ 'https://download.pytorch.org/models/ssdlite320_mobilenet_v3_large_coco-a79551df.pth'
21
22
}
22
23
23
24
@@ -164,6 +165,27 @@ def ssdlite320_mobilenet_v3_large(pretrained: bool = False, progress: bool = Tru
164
165
pretrained_backbone : bool = False , trainable_backbone_layers : Optional [int ] = None ,
165
166
norm_layer : Optional [Callable [..., nn .Module ]] = None ,
166
167
** kwargs : Any ):
168
+ """
169
+ Constructs an SSDlite model with a MobileNetV3 Large backbone. See `SSD` for more details.
170
+
171
+ Example:
172
+
173
+ >>> model = torchvision.models.detection.ssdlite320_mobilenet_v3_large(pretrained=True)
174
+ >>> model.eval()
175
+ >>> x = [torch.rand(3, 320, 320), torch.rand(3, 500, 400)]
176
+ >>> predictions = model(x)
177
+
178
+ Args:
179
+ norm_layer:
180
+ **kwargs:
181
+ pretrained (bool): If True, returns a model pre-trained on COCO train2017
182
+ progress (bool): If True, displays a progress bar of the download to stderr
183
+ num_classes (int): number of output classes of the model (including the background)
184
+ pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet
185
+ trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block.
186
+ Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable.
187
+ norm_layer (callable, optional): Module specifying the normalization layer to use.
188
+ """
167
189
trainable_backbone_layers = _validate_trainable_layers (
168
190
pretrained or pretrained_backbone , trainable_backbone_layers , 6 , 6 )
169
191
@@ -186,10 +208,10 @@ def ssdlite320_mobilenet_v3_large(pretrained: bool = False, progress: bool = Tru
186
208
assert len (out_channels ) == len (anchor_generator .aspect_ratios )
187
209
188
210
defaults = {
189
- "score_thresh" : 1e-8 ,
190
- "nms_thresh" : 0.6 ,
191
- "detections_per_img" : 100 ,
192
- "topk_candidates" : 100 ,
211
+ "score_thresh" : 0.001 ,
212
+ "nms_thresh" : 0.55 ,
213
+ "detections_per_img" : 300 ,
214
+ "topk_candidates" : 300 ,
193
215
}
194
216
kwargs = {** defaults , ** kwargs }
195
217
model = SSD (backbone , anchor_generator , size , num_classes ,
0 commit comments