inception_v3¶
- torchvision.models.inception_v3(*, weights: Optional[Inception_V3_Weights] = None, progress: bool = True, **kwargs: Any) Inception3 [原始碼]¶
來自重新思考用於電腦視覺的 Inception 架構的 Inception v3 模型架構。
注意
重要:與其他模型相反,inception_v3 預期張量的大小為 N x 3 x 299 x 299,因此請確保您的影像大小相應。
- 參數:
weights (
Inception_V3_Weights
, optional) – 模型的預訓練權重。 詳情以及可能的值,請參閱下方的Inception_V3_Weights
。 預設情況下,不使用任何預先訓練的權重。progress (bool, optional) – 如果為 True,則會顯示下載到 stderr 的進度列。 預設值為 True。
**kwargs – 傳遞給
torchvision.models.Inception3
基底類別的參數。 請參考 原始碼 以取得關於此類別的更多詳細資訊。
- class torchvision.models.Inception_V3_Weights(value)[source]¶
上述模型建構器接受以下值作為
weights
參數。Inception_V3_Weights.DEFAULT
等同於Inception_V3_Weights.IMAGENET1K_V1
。 您也可以使用字串,例如weights='DEFAULT'
或weights='IMAGENET1K_V1'
。Inception_V3_Weights.IMAGENET1K_V1:
這些權重從原始論文移植而來。 也可作為
Inception_V3_Weights.DEFAULT
使用。acc@1 (在 ImageNet-1K 上)
77.294
acc@5 (在 ImageNet-1K 上)
93.45
num_params
27161264
min_size
height=75, width=75
categories
tench, goldfish, great white shark, … (省略 997 個)
recipe
GFLOPS
5.71
File size
103.9 MB
推論轉換可在
Inception_V3_Weights.IMAGENET1K_V1.transforms
中取得,並執行以下預處理操作: 接受PIL.Image
、批次處理的(B, C, H, W)
和單一的(C, H, W)
影像torch.Tensor
物件。 影像會使用interpolation=InterpolationMode.BILINEAR
調整大小至resize_size=[342]
,然後進行crop_size=[299]
的中心裁剪。 最後,這些值會先重新縮放到[0.0, 1.0]
,然後使用mean=[0.485, 0.456, 0.406]
和std=[0.229, 0.224, 0.225]
進行正規化。