fasterrcnn_mobilenet_v3_large_320_fpn¶
- torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn(*, weights: Optional[FasterRCNN_MobileNet_V3_Large_320_FPN_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, **kwargs: Any) FasterRCNN [source]¶
低分辨率 Faster R-CNN 模型,使用 MobileNetV3-Large 主干网络,针对移动用例进行调优。
警告
检测模块处于 Beta 阶段,不保证向后兼容性。
它的工作方式类似于使用 ResNet-50 FPN 主干网络的 Faster R-CNN 模型。有关更多详细信息,请参阅
fasterrcnn_resnet50_fpn()
。示例
>>> model = torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn(weights=FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.DEFAULT) >>> model.eval() >>> x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)] >>> predictions = model(x)
- 参数:
weights (
FasterRCNN_MobileNet_V3_Large_320_FPN_Weights
, 可选) – 要使用的预训练权重。有关更多详细信息和可能的值,请参阅下方的FasterRCNN_MobileNet_V3_Large_320_FPN_Weights
。默认情况下不使用预训练权重。progress (bool, 可选) – 如果为 True,则在标准错误输出中显示下载进度条。默认为 True。
num_classes (int, 可选) – 模型的输出类别数(包括背景类别)
weights_backbone (
MobileNet_V3_Large_Weights
, 可选) – 主干网络的预训练权重。trainable_backbone_layers (int, 可选) – 从最后一个块开始的可训练(非冻结)层数。有效值在 0 到 6 之间,其中 6 表示所有主干层都是可训练的。如果传入
None
(默认值),则此值设置为 3。**kwargs – 传递给
torchvision.models.detection.faster_rcnn.FasterRCNN
基类的参数。有关此类的更多详细信息,请参阅源代码。
- class torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights(value)[source]¶
上面的模型构建器接受以下值作为
weights
参数。FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.DEFAULT
等同于FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.COCO_V1
。您也可以使用字符串,例如weights='DEFAULT'
或weights='COCO_V1'
。FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.COCO_V1:
这些权重是按照与论文中相似的训练方法生成的。也可通过
FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.DEFAULT
获取。box_map(在 COCO-val2017 数据集上)
22.8
类别
__background__, person, bicycle, … (省略了 88 个)
min_size
height=1, width=1
num_params
19386354
训练方法
GFLOPS
0.72
文件大小
74.2 MB
推理变换可在
FasterRCNN_MobileNet_V3_Large_320_FPN_Weights.COCO_V1.transforms
中获取,并执行以下预处理操作:接受PIL.Image
、批处理的(B, C, H, W)
和单个(C, H, W)
图像torch.Tensor
对象。图像会被重新缩放到[0.0, 1.0]
。