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[原始碼]¶
一個低解析度的 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, optional) – 如果為 True,則在 stderr 上顯示下載進度條。預設為 True。
num_classes (int, 可選) – 模型的輸出類別數(包括背景)
weights_backbone (
MobileNet_V3_Large_Weights, optional) – 骨幹網路的預訓練權重。trainable_backbone_layers (int, optional) – 從最後一個塊開始的可訓練(未凍結)的層數。有效值為 0 到 6 之間,其中 6 表示所有主幹層都可訓練。如果傳入
None(預設值),則此值設定為 3。**kwargs – 傳遞給
torchvision.models.detection.faster_rcnn.FasterRCNN基類的引數。有關此類的更多詳細資訊,請參閱 原始碼。
- class torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_320_FPN_Weights(value)[原始碼]¶
上面的模型構建器接受以下值作為
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
引數數量
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]。