@@ -431,24 +431,26 @@ def _efficientnet_conf(
431431
432432_COMMON_META : Dict [str , Any ] =  {
433433    "categories" : _IMAGENET_CATEGORIES ,
434-     "recipe" : "https://github.com/pytorch/vision/tree/main/references/classification#efficientnet" ,
435434}
436435
437436
438437_COMMON_META_V1  =  {
439438    ** _COMMON_META ,
440439    "min_size" : (1 , 1 ),
440+     "recipe" : "https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v1" ,
441441}
442442
443443
444444_COMMON_META_V2  =  {
445445    ** _COMMON_META ,
446446    "min_size" : (33 , 33 ),
447+     "recipe" : "https://github.com/pytorch/vision/tree/main/references/classification#efficientnet-v2" ,
447448}
448449
449450
450451class  EfficientNet_B0_Weights (WeightsEnum ):
451452    IMAGENET1K_V1  =  Weights (
453+         # Weights ported from https://github.com/rwightman/pytorch-image-models/ 
452454        url = "https://download.pytorch.org/models/efficientnet_b0_rwightman-3dd342df.pth" ,
453455        transforms = partial (
454456            ImageClassification , crop_size = 224 , resize_size = 256 , interpolation = InterpolationMode .BICUBIC 
@@ -460,13 +462,15 @@ class EfficientNet_B0_Weights(WeightsEnum):
460462                "acc@1" : 77.692 ,
461463                "acc@5" : 93.532 ,
462464            },
465+             "_docs" : """These weights are ported from the original paper.""" ,
463466        },
464467    )
465468    DEFAULT  =  IMAGENET1K_V1 
466469
467470
468471class  EfficientNet_B1_Weights (WeightsEnum ):
469472    IMAGENET1K_V1  =  Weights (
473+         # Weights ported from https://github.com/rwightman/pytorch-image-models/ 
470474        url = "https://download.pytorch.org/models/efficientnet_b1_rwightman-533bc792.pth" ,
471475        transforms = partial (
472476            ImageClassification , crop_size = 240 , resize_size = 256 , interpolation = InterpolationMode .BICUBIC 
@@ -478,6 +482,7 @@ class EfficientNet_B1_Weights(WeightsEnum):
478482                "acc@1" : 78.642 ,
479483                "acc@5" : 94.186 ,
480484            },
485+             "_docs" : """These weights are ported from the original paper.""" ,
481486        },
482487    )
483488    IMAGENET1K_V2  =  Weights (
@@ -493,13 +498,19 @@ class EfficientNet_B1_Weights(WeightsEnum):
493498                "acc@1" : 79.838 ,
494499                "acc@5" : 94.934 ,
495500            },
501+             "_docs" : """ 
502+                 These weights improve upon the results of the original paper by using a modified version of TorchVision's 
503+                 `new training recipe 
504+                 <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_. 
505+             """ ,
496506        },
497507    )
498508    DEFAULT  =  IMAGENET1K_V2 
499509
500510
501511class  EfficientNet_B2_Weights (WeightsEnum ):
502512    IMAGENET1K_V1  =  Weights (
513+         # Weights ported from https://github.com/rwightman/pytorch-image-models/ 
503514        url = "https://download.pytorch.org/models/efficientnet_b2_rwightman-bcdf34b7.pth" ,
504515        transforms = partial (
505516            ImageClassification , crop_size = 288 , resize_size = 288 , interpolation = InterpolationMode .BICUBIC 
@@ -511,13 +522,15 @@ class EfficientNet_B2_Weights(WeightsEnum):
511522                "acc@1" : 80.608 ,
512523                "acc@5" : 95.310 ,
513524            },
525+             "_docs" : """These weights are ported from the original paper.""" ,
514526        },
515527    )
516528    DEFAULT  =  IMAGENET1K_V1 
517529
518530
519531class  EfficientNet_B3_Weights (WeightsEnum ):
520532    IMAGENET1K_V1  =  Weights (
533+         # Weights ported from https://github.com/rwightman/pytorch-image-models/ 
521534        url = "https://download.pytorch.org/models/efficientnet_b3_rwightman-cf984f9c.pth" ,
522535        transforms = partial (
523536            ImageClassification , crop_size = 300 , resize_size = 320 , interpolation = InterpolationMode .BICUBIC 
@@ -529,13 +542,15 @@ class EfficientNet_B3_Weights(WeightsEnum):
529542                "acc@1" : 82.008 ,
530543                "acc@5" : 96.054 ,
531544            },
545+             "_docs" : """These weights are ported from the original paper.""" ,
532546        },
533547    )
534548    DEFAULT  =  IMAGENET1K_V1 
535549
536550
537551class  EfficientNet_B4_Weights (WeightsEnum ):
538552    IMAGENET1K_V1  =  Weights (
553+         # Weights ported from https://github.com/rwightman/pytorch-image-models/ 
539554        url = "https://download.pytorch.org/models/efficientnet_b4_rwightman-7eb33cd5.pth" ,
540555        transforms = partial (
541556            ImageClassification , crop_size = 380 , resize_size = 384 , interpolation = InterpolationMode .BICUBIC 
@@ -547,13 +562,15 @@ class EfficientNet_B4_Weights(WeightsEnum):
547562                "acc@1" : 83.384 ,
548563                "acc@5" : 96.594 ,
549564            },
565+             "_docs" : """These weights are ported from the original paper.""" ,
550566        },
551567    )
552568    DEFAULT  =  IMAGENET1K_V1 
553569
554570
555571class  EfficientNet_B5_Weights (WeightsEnum ):
556572    IMAGENET1K_V1  =  Weights (
573+         # Weights ported from https://github.com/lukemelas/EfficientNet-PyTorch/ 
557574        url = "https://download.pytorch.org/models/efficientnet_b5_lukemelas-b6417697.pth" ,
558575        transforms = partial (
559576            ImageClassification , crop_size = 456 , resize_size = 456 , interpolation = InterpolationMode .BICUBIC 
@@ -565,13 +582,15 @@ class EfficientNet_B5_Weights(WeightsEnum):
565582                "acc@1" : 83.444 ,
566583                "acc@5" : 96.628 ,
567584            },
585+             "_docs" : """These weights are ported from the original paper.""" ,
568586        },
569587    )
570588    DEFAULT  =  IMAGENET1K_V1 
571589
572590
573591class  EfficientNet_B6_Weights (WeightsEnum ):
574592    IMAGENET1K_V1  =  Weights (
593+         # Weights ported from https://github.com/lukemelas/EfficientNet-PyTorch/ 
575594        url = "https://download.pytorch.org/models/efficientnet_b6_lukemelas-c76e70fd.pth" ,
576595        transforms = partial (
577596            ImageClassification , crop_size = 528 , resize_size = 528 , interpolation = InterpolationMode .BICUBIC 
@@ -583,13 +602,15 @@ class EfficientNet_B6_Weights(WeightsEnum):
583602                "acc@1" : 84.008 ,
584603                "acc@5" : 96.916 ,
585604            },
605+             "_docs" : """These weights are ported from the original paper.""" ,
586606        },
587607    )
588608    DEFAULT  =  IMAGENET1K_V1 
589609
590610
591611class  EfficientNet_B7_Weights (WeightsEnum ):
592612    IMAGENET1K_V1  =  Weights (
613+         # Weights ported from https://github.com/lukemelas/EfficientNet-PyTorch/ 
593614        url = "https://download.pytorch.org/models/efficientnet_b7_lukemelas-dcc49843.pth" ,
594615        transforms = partial (
595616            ImageClassification , crop_size = 600 , resize_size = 600 , interpolation = InterpolationMode .BICUBIC 
@@ -601,6 +622,7 @@ class EfficientNet_B7_Weights(WeightsEnum):
601622                "acc@1" : 84.122 ,
602623                "acc@5" : 96.908 ,
603624            },
625+             "_docs" : """These weights are ported from the original paper.""" ,
604626        },
605627    )
606628    DEFAULT  =  IMAGENET1K_V1 
@@ -622,6 +644,11 @@ class EfficientNet_V2_S_Weights(WeightsEnum):
622644                "acc@1" : 84.228 ,
623645                "acc@5" : 96.878 ,
624646            },
647+             "_docs" : """ 
648+                 These weights improve upon the results of the original paper by using a modified version of TorchVision's 
649+                 `new training recipe 
650+                 <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_. 
651+             """ ,
625652        },
626653    )
627654    DEFAULT  =  IMAGENET1K_V1 
@@ -643,12 +670,18 @@ class EfficientNet_V2_M_Weights(WeightsEnum):
643670                "acc@1" : 85.112 ,
644671                "acc@5" : 97.156 ,
645672            },
673+             "_docs" : """ 
674+                 These weights improve upon the results of the original paper by using a modified version of TorchVision's 
675+                 `new training recipe 
676+                 <https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/>`_. 
677+             """ ,
646678        },
647679    )
648680    DEFAULT  =  IMAGENET1K_V1 
649681
650682
651683class  EfficientNet_V2_L_Weights (WeightsEnum ):
684+     # Weights ported from https://github.com/google/automl/tree/master/efficientnetv2 
652685    IMAGENET1K_V1  =  Weights (
653686        url = "https://download.pytorch.org/models/efficientnet_v2_l-59c71312.pth" ,
654687        transforms = partial (
@@ -666,6 +699,7 @@ class EfficientNet_V2_L_Weights(WeightsEnum):
666699                "acc@1" : 85.808 ,
667700                "acc@5" : 97.788 ,
668701            },
702+             "_docs" : """These weights are ported from the original paper.""" ,
669703        },
670704    )
671705    DEFAULT  =  IMAGENET1K_V1 
@@ -1036,13 +1070,11 @@ def efficientnet_v2_l(
10361070
10371071model_urls  =  _ModelURLs (
10381072    {
1039-         # Weights ported from https://github.com/rwightman/pytorch-image-models/ 
10401073        "efficientnet_b0" : EfficientNet_B0_Weights .IMAGENET1K_V1 .url ,
10411074        "efficientnet_b1" : EfficientNet_B1_Weights .IMAGENET1K_V1 .url ,
10421075        "efficientnet_b2" : EfficientNet_B2_Weights .IMAGENET1K_V1 .url ,
10431076        "efficientnet_b3" : EfficientNet_B3_Weights .IMAGENET1K_V1 .url ,
10441077        "efficientnet_b4" : EfficientNet_B4_Weights .IMAGENET1K_V1 .url ,
1045-         # Weights ported from https://github.com/lukemelas/EfficientNet-PyTorch/ 
10461078        "efficientnet_b5" : EfficientNet_B5_Weights .IMAGENET1K_V1 .url ,
10471079        "efficientnet_b6" : EfficientNet_B6_Weights .IMAGENET1K_V1 .url ,
10481080        "efficientnet_b7" : EfficientNet_B7_Weights .IMAGENET1K_V1 .url ,
0 commit comments