快捷鍵

fasterrcnn_mobilenet_v3_large_fpn

torchvision.models.detection.fasterrcnn_mobilenet_v3_large_fpn(*, weights: Optional[FasterRCNN_MobileNet_V3_Large_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]

建構具有 MobileNetV3-Large FPN backbone 的高解析度 Faster R-CNN 模型。

警告

偵測模組目前為 Beta 階段,不保證向後相容性。

其運作方式與使用 ResNet-50 FPN backbone 的 Faster R-CNN 類似。詳情請參閱 fasterrcnn_resnet50_fpn()

範例

>>> model = torchvision.models.detection.fasterrcnn_mobilenet_v3_large_fpn(weights=FasterRCNN_MobileNet_V3_Large_FPN_Weights.DEFAULT)
>>> model.eval()
>>> x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
>>> predictions = model(x)
參數:
  • weights (FasterRCNN_MobileNet_V3_Large_FPN_Weights, 選用) – 要使用的預訓練權重。詳情及可能的值請參閱下方的 FasterRCNN_MobileNet_V3_Large_FPN_Weights。預設情況下,不使用預訓練權重。

  • progress (bool, 選用) – 若為 True,則在 stderr 顯示下載進度條。預設值為 True。

  • num_classes (int, 選用) – 模型輸出的類別數量 (包含背景)

  • weights_backbone (MobileNet_V3_Large_Weights, 選用) – backbone 的預訓練權重。

  • trainable_backbone_layers (int, 選用) – 從最後一個區塊開始的可訓練 (非凍結) 層數。有效值介於 0 到 6 之間,6 代表所有 backbone 層皆可訓練。若傳入 None (預設值),則此值設定為 3。

  • **kwargs – 傳遞至 torchvision.models.detection.faster_rcnn.FasterRCNN 基底類別的參數。關於此類別的更多詳情,請參閱原始碼

class torchvision.models.detection.FasterRCNN_MobileNet_V3_Large_FPN_Weights(value)[source]

上述模型建構器接受以下值作為 weights 參數。FasterRCNN_MobileNet_V3_Large_FPN_Weights.DEFAULT 等同於 FasterRCNN_MobileNet_V3_Large_FPN_Weights.COCO_V1。您也可以使用字串,例如 weights='DEFAULT'weights='COCO_V1'

FasterRCNN_MobileNet_V3_Large_FPN_Weights.COCO_V1:

這些權重是依照論文中類似的訓練配方產生的。也可作為 FasterRCNN_MobileNet_V3_Large_FPN_Weights.DEFAULT 使用。

box_map (在 COCO-val2017 上)

32.8

類別

__background__, person, bicycle, … (省略 88 個)

min_size

height=1, width=1

num_params

19386354

配方

連結

GFLOPS

4.49

檔案大小

74.2 MB

推論轉換可在 FasterRCNN_MobileNet_V3_Large_FPN_Weights.COCO_V1.transforms 中取得,並執行以下預處理操作:接受 PIL.Image、批次 (B, C, H, W) 和單張 (C, H, W) 影像 torch.Tensor 物件。影像會被重新縮放至 [0.0, 1.0]

文件

存取 PyTorch 的完整開發者文件

查看文件

教學

取得針對初學者和進階開發者的深入教學

查看教學

資源

尋找開發資源並獲得解答

查看資源