Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regnet model from SWAG #5722

Merged
merged 5 commits into from
Apr 1, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions torchvision/models/regnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ def _regnet(
"interpolation": InterpolationMode.BILINEAR,
}

_COMMON_SWAG_META = {
**_COMMON_META,
"publication_year": 2022,
"size": (384, 384),
"recipe": "https://github.com/facebookresearch/SWAG",
"license": "https://github.com/facebookresearch/SWAG/blob/main/LICENSE",
"interpolation": InterpolationMode.BICUBIC,
}


class RegNet_Y_400MF_Weights(WeightsEnum):
IMAGENET1K_V1 = Weights(
Expand Down Expand Up @@ -566,6 +575,18 @@ class RegNet_Y_16GF_Weights(WeightsEnum):
"acc@5": 96.328,
},
)
IMAGENET1K_SWAG_V1 = Weights(
url="https://download.pytorch.org/models/regnet_y_16gf_swag-43afe44d.pth",
transforms=partial(
ImageClassification, crop_size=384, resize_size=384, interpolation=InterpolationMode.BICUBIC
),
meta={
**_COMMON_SWAG_META,
"num_params": 83590140,
"acc@1": 86.012,
"acc@5": 98.054,
},
)
DEFAULT = IMAGENET1K_V2


Expand All @@ -592,6 +613,18 @@ class RegNet_Y_32GF_Weights(WeightsEnum):
"acc@5": 96.498,
},
)
IMAGENET1K_SWAG_V1 = Weights(
url="https://download.pytorch.org/models/regnet_y_32gf_swag-04fdfa75.pth",
transforms=partial(
ImageClassification, crop_size=384, resize_size=384, interpolation=InterpolationMode.BICUBIC
),
meta={
**_COMMON_SWAG_META,
"num_params": 145046770,
"acc@1": 86.838,
"acc@5": 98.362,
},
)
DEFAULT = IMAGENET1K_V2


Expand Down