31
31
]
32
32
33
33
34
- def _vgg (arch : str , cfg : str , batch_norm : bool , weights : Optional [Weights ], progress : bool , ** kwargs : Any ) -> VGG :
34
+ def _vgg (cfg : str , batch_norm : bool , weights : Optional [Weights ], progress : bool , ** kwargs : Any ) -> VGG :
35
35
if weights is not None :
36
36
kwargs ["num_classes" ] = len (weights .meta ["categories" ])
37
37
model = VGG (make_layers (cfgs [cfg ], batch_norm = batch_norm ), ** kwargs )
@@ -150,7 +150,7 @@ def vgg11(weights: Optional[VGG11Weights] = None, progress: bool = True, **kwarg
150
150
weights = VGG11Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
151
151
weights = VGG11Weights .verify (weights )
152
152
153
- return _vgg ("vgg11" , " A" , False , weights , progress , ** kwargs )
153
+ return _vgg ("A" , False , weights , progress , ** kwargs )
154
154
155
155
156
156
def vgg11_bn (weights : Optional [VGG11BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -159,7 +159,7 @@ def vgg11_bn(weights: Optional[VGG11BNWeights] = None, progress: bool = True, **
159
159
weights = VGG11BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
160
160
weights = VGG11BNWeights .verify (weights )
161
161
162
- return _vgg ("vgg11_bn" , " A" , True , weights , progress , ** kwargs )
162
+ return _vgg ("A" , True , weights , progress , ** kwargs )
163
163
164
164
165
165
def vgg13 (weights : Optional [VGG13Weights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -168,7 +168,7 @@ def vgg13(weights: Optional[VGG13Weights] = None, progress: bool = True, **kwarg
168
168
weights = VGG13Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
169
169
weights = VGG13Weights .verify (weights )
170
170
171
- return _vgg ("vgg13" , " B" , False , weights , progress , ** kwargs )
171
+ return _vgg ("B" , False , weights , progress , ** kwargs )
172
172
173
173
174
174
def vgg13_bn (weights : Optional [VGG13BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -177,7 +177,7 @@ def vgg13_bn(weights: Optional[VGG13BNWeights] = None, progress: bool = True, **
177
177
weights = VGG13BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
178
178
weights = VGG13BNWeights .verify (weights )
179
179
180
- return _vgg ("vgg13_bn" , " B" , True , weights , progress , ** kwargs )
180
+ return _vgg ("B" , True , weights , progress , ** kwargs )
181
181
182
182
183
183
def vgg16 (weights : Optional [VGG16Weights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -186,7 +186,7 @@ def vgg16(weights: Optional[VGG16Weights] = None, progress: bool = True, **kwarg
186
186
weights = VGG16Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
187
187
weights = VGG16Weights .verify (weights )
188
188
189
- return _vgg ("vgg16" , " D" , False , weights , progress , ** kwargs )
189
+ return _vgg ("D" , False , weights , progress , ** kwargs )
190
190
191
191
192
192
def vgg16_bn (weights : Optional [VGG16BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -195,7 +195,7 @@ def vgg16_bn(weights: Optional[VGG16BNWeights] = None, progress: bool = True, **
195
195
weights = VGG16BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
196
196
weights = VGG16BNWeights .verify (weights )
197
197
198
- return _vgg ("vgg16_bn" , " D" , True , weights , progress , ** kwargs )
198
+ return _vgg ("D" , True , weights , progress , ** kwargs )
199
199
200
200
201
201
def vgg19 (weights : Optional [VGG19Weights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -204,7 +204,7 @@ def vgg19(weights: Optional[VGG19Weights] = None, progress: bool = True, **kwarg
204
204
weights = VGG19Weights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
205
205
weights = VGG19Weights .verify (weights )
206
206
207
- return _vgg ("vgg19" , " E" , False , weights , progress , ** kwargs )
207
+ return _vgg ("E" , False , weights , progress , ** kwargs )
208
208
209
209
210
210
def vgg19_bn (weights : Optional [VGG19BNWeights ] = None , progress : bool = True , ** kwargs : Any ) -> VGG :
@@ -213,4 +213,4 @@ def vgg19_bn(weights: Optional[VGG19BNWeights] = None, progress: bool = True, **
213
213
weights = VGG19BNWeights .ImageNet1K_RefV1 if kwargs .pop ("pretrained" ) else None
214
214
weights = VGG19BNWeights .verify (weights )
215
215
216
- return _vgg ("vgg19_bn" , " E" , True , weights , progress , ** kwargs )
216
+ return _vgg ("E" , True , weights , progress , ** kwargs )
0 commit comments