ssdlite320_mobilenet_v3_large¶
- torchvision.models.detection.ssdlite320_mobilenet_v3_large(*, weights: Optional[SSDLite320_MobileNet_V3_Large_Weights] = None, progress: bool = True, num_classes: Optional[int] = None, weights_backbone: Optional[MobileNet_V3_Large_Weights] = MobileNet_V3_Large_Weights.IMAGENET1K_V1, trainable_backbone_layers: Optional[int] = None, norm_layer: Optional[Callable[[...], Module]] = None, **kwargs: Any) SSD [来源]¶
带有 320x320 输入尺寸和 MobileNetV3 Large 主干网络的 SSDlite 模型架构,如论文 Searching for MobileNetV3 和 MobileNetV2: Inverted Residuals and Linear Bottlenecks 中所述。
警告
检测模块处于 Beta 阶段,不保证向后兼容性。
更多详细信息请参见
ssd300_vgg16()
。示例
>>> model = torchvision.models.detection.ssdlite320_mobilenet_v3_large(weights=SSDLite320_MobileNet_V3_Large_Weights.DEFAULT) >>> model.eval() >>> x = [torch.rand(3, 320, 320), torch.rand(3, 500, 400)] >>> predictions = model(x)
- 参数:
weights (
SSDLite320_MobileNet_V3_Large_Weights
, 可选) – 要使用的预训练权重。更多详细信息和可能的值请参见下方的SSDLite320_MobileNet_V3_Large_Weights
。默认情况下不使用预训练权重。progress (bool, 可选) – 如果为 True,则在 stderr 中显示下载进度条。默认为 True。
num_classes (int, 可选) – 模型的输出类别数量(包括背景)。
weights_backbone (
MobileNet_V3_Large_Weights
, 可选) – 主干网络的预训练权重。trainable_backbone_layers (int, 可选) – 从最终块开始的可训练(未冻结)层数。有效值为 0 到 6 之间,其中 6 表示所有主干网络层都是可训练的。如果传入
None
(默认值),则此值设置为 6。norm_layer (callable, 可选) – 指定要使用的归一化层模块。
**kwargs – 传递给
torchvision.models.detection.ssd.SSD
基类的参数。有关此类的更多详细信息,请参阅源代码。
- 类 torchvision.models.detection.SSDLite320_MobileNet_V3_Large_Weights(value)[来源]¶
上面的模型构建器接受以下值作为
weights
参数。SSDLite320_MobileNet_V3_Large_Weights.DEFAULT
等同于SSDLite320_MobileNet_V3_Large_Weights.COCO_V1
。您也可以使用字符串,例如weights='DEFAULT'
或weights='COCO_V1'
。SSDLite320_MobileNet_V3_Large_Weights.COCO_V1:
这些权重是通过遵循与论文中相似的训练方案产生的。也可用作
SSDLite320_MobileNet_V3_Large_Weights.DEFAULT
。box_map (在 COCO-val2017 上)
21.3
num_params
3440060
类别
__background__, person, bicycle, ... (省略 88 个)
min_size
height=1, width=1
方案
GFLOPS
0.58
文件大小
13.4 MB
推理转换可通过
SSDLite320_MobileNet_V3_Large_Weights.COCO_V1.transforms
获取,并执行以下预处理操作:接受PIL.Image
、批处理的(B, C, H, W)
和单个(C, H, W)
图像torch.Tensor
对象。图像被重新缩放到[0.0, 1.0]
。