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

Weights: add sha256 suffix #1105

Merged
merged 2 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion docs/api/resnet_pretrained_weights.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ResNet18_Weights.SENTINEL2_ALL_MOCO,13,`link <https://github.com/zhu-xlab/SSL4EO
ResNet18_Weights.SENTINEL2_RGB_MOCO, 3,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,,,,
ResNet18_Weights.SENTINEL2_RGB_SECO, 3,`link <https://github.com/ServiceNow/seasonal-contrast>`__,`link <https://arxiv.org/abs/2103.16607>`__,87.27,93.14,,46.94
ResNet50_Weights.SENTINEL1_ALL_MOCO, 2,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,,,,
ResNet50_Weights.SENTINEL2_ALL_DINO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,90.7,99.1,63.6,
ResNet50_Weights.SENTINEL2_ALL_MOCO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,91.8,99.1,60.9,
ResNet50_Weights.SENTINEL2_RGB_MOCO, 3,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,,,,
ResNet50_Weights.SENTINEL2_ALL_DINO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,90.7,99.1,63.6,
ResNet50_Weights.SENTINEL2_RGB_SECO, 3,`link <https://github.com/ServiceNow/seasonal-contrast>`__,`link <https://arxiv.org/abs/2103.16607>`__,87.81,,,
2 changes: 1 addition & 1 deletion docs/api/vit_pretrained_weights.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Weight,Channels,Source,Citation,BigEarthNet,EuroSAT,So2Sat,OSCD
ViTSmall16_Weights.SENTINEL2_ALL_MOCO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,89.9,98.6,61.6,
ViTSmall16_Weights.SENTINEL2_ALL_DINO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,90.5,99.0,62.2,
ViTSmall16_Weights.SENTINEL2_ALL_MOCO,13,`link <https://github.com/zhu-xlab/SSL4EO-S12>`__,`link <https://arxiv.org/abs/2211.07044>`__,89.9,98.6,61.6,
54 changes: 15 additions & 39 deletions torchgeo/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ class ResNet18_Weights(WeightsEnum): # type: ignore[misc]
"""

SENTINEL2_ALL_MOCO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet18_sentinel2_all_moco/"
"resolve/main/resnet18_sentinel2_all_moco.pth"
),
url="https://huggingface.co/torchgeo/resnet18_sentinel2_all_moco/resolve/main/resnet18_sentinel2_all_moco-59bfdff9.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
Expand All @@ -51,10 +48,7 @@ class ResNet18_Weights(WeightsEnum): # type: ignore[misc]
)

SENTINEL2_RGB_MOCO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet18_sentinel2_rgb_moco/"
"resolve/main/resnet18_sentinel2_rgb_moco.pth"
),
url="https://huggingface.co/torchgeo/resnet18_sentinel2_rgb_moco/resolve/main/resnet18_sentinel2_rgb_moco-e3a335e3.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
Expand All @@ -67,10 +61,7 @@ class ResNet18_Weights(WeightsEnum): # type: ignore[misc]
)

SENTINEL2_RGB_SECO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet18_sentinel2_rgb_seco/"
"resolve/main/resnet18_sentinel2_rgb_seco.ckpt"
),
url="https://huggingface.co/torchgeo/resnet18_sentinel2_rgb_seco/resolve/main/resnet18_sentinel2_rgb_seco-9976a9cb.pth", # noqa: E501
transforms=nn.Identity(),
meta={
"dataset": "SeCo Dataset",
Expand All @@ -93,10 +84,7 @@ class ResNet50_Weights(WeightsEnum): # type: ignore[misc]
"""

SENTINEL1_ALL_MOCO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet50_sentinel1_all_moco/"
"resolve/main/resnet50_sentinel1_all_moco.pth"
),
url="https://huggingface.co/torchgeo/resnet50_sentinel1_all_moco/resolve/main/resnet50_sentinel1_all_moco-906e4356.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
Expand All @@ -108,59 +96,47 @@ class ResNet50_Weights(WeightsEnum): # type: ignore[misc]
},
)

SENTINEL2_ALL_MOCO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet50_sentinel2_all_moco/"
"resolve/main/resnet50_sentinel2_all_moco.pth"
),
SENTINEL2_ALL_DINO = Weights(
url="https://huggingface.co/torchgeo/resnet50_sentinel2_all_dino/resolve/main/resnet50_sentinel2_all_dino-d6c330e9.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
"in_chans": 13,
"model": "resnet50",
"publication": "https://arxiv.org/abs/2211.07044",
"repo": "https://github.com/zhu-xlab/SSL4EO-S12",
"ssl_method": "moco",
"ssl_method": "dino",
},
)

SENTINEL2_RGB_MOCO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet50_sentinel2_rgb_moco/"
"resolve/main/resnet50_sentinel2_rgb_moco.pth"
),
SENTINEL2_ALL_MOCO = Weights(
url="https://huggingface.co/torchgeo/resnet50_sentinel2_all_moco/resolve/main/resnet50_sentinel2_all_moco-df8b932e.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
"in_chans": 3,
"in_chans": 13,
"model": "resnet50",
"publication": "https://arxiv.org/abs/2211.07044",
"repo": "https://github.com/zhu-xlab/SSL4EO-S12",
"ssl_method": "moco",
},
)

SENTINEL2_ALL_DINO = Weights(
url=(
"https://huggingface.co/torchgeo/resnet50_sentinel2_all_dino/"
"resolve/main/resnet50_sentinel2_all_dino.pth"
),
SENTINEL2_RGB_MOCO = Weights(
url="https://huggingface.co/torchgeo/resnet50_sentinel2_rgb_moco/resolve/main/resnet50_sentinel2_rgb_moco-2b57ba8b.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
"in_chans": 13,
"in_chans": 3,
"model": "resnet50",
"publication": "https://arxiv.org/abs/2211.07044",
"repo": "https://github.com/zhu-xlab/SSL4EO-S12",
"ssl_method": "dino",
"ssl_method": "moco",
},
)

SENTINEL2_RGB_SECO = Weights(
adamjstewart marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have defined the zhu_lab_transforms, and I was looking into the Seco code again and at least for the bigearthnet datamodule on which they run experiments, augmentations are defined here. Do you want to add those?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Can you add it in a separate PR though? That can fix #1042.

url=(
"https://huggingface.co/torchgeo/resnet50_sentinel2_rgb_seco/"
"resolve/main/resnet50_sentinel2_rgb_seco.ckpt"
),
url="https://huggingface.co/torchgeo/resnet50_sentinel2_rgb_seco/blob/main/resnet50_sentinel2_rgb_seco-584035db.pth", # noqa: E501
transforms=nn.Identity(),
meta={
"dataset": "SeCo Dataset",
Expand Down
18 changes: 6 additions & 12 deletions torchgeo/models/vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,29 @@ class ViTSmall16_Weights(WeightsEnum): # type: ignore[misc]
.. versionadded:: 0.4
"""

SENTINEL2_ALL_MOCO = Weights(
url=(
"https://huggingface.co/torchgeo/vit_small_patch16_224_sentinel2_all_moco/"
"resolve/main/vit_small_patch16_224_sentinel2_all_moco.pth"
),
SENTINEL2_ALL_DINO = Weights(
url="https://huggingface.co/torchgeo/vit_small_patch16_224_sentinel2_all_dino/resolve/main/vit_small_patch16_224_sentinel2_all_dino-36bcc127.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
"in_chans": 13,
"model": "vit_small_patch16_224",
"publication": "https://arxiv.org/abs/2211.07044",
"repo": "https://github.com/zhu-xlab/SSL4EO-S12",
"ssl_method": "moco",
"ssl_method": "dino",
},
)

SENTINEL2_ALL_DINO = Weights(
url=(
"https://huggingface.co/torchgeo/vit_small_patch16_224_sentinel2_all_dino/"
"resolve/main/vit_small_patch16_224_sentinel2_all_dino.pth"
),
SENTINEL2_ALL_MOCO = Weights(
url="https://huggingface.co/torchgeo/vit_small_patch16_224_sentinel2_all_moco/resolve/main/vit_small_patch16_224_sentinel2_all_moco-67c9032d.pth", # noqa: E501
transforms=_zhu_xlab_transforms,
meta={
"dataset": "SSL4EO-S12",
"in_chans": 13,
"model": "vit_small_patch16_224",
"publication": "https://arxiv.org/abs/2211.07044",
"repo": "https://github.com/zhu-xlab/SSL4EO-S12",
"ssl_method": "dino",
"ssl_method": "moco",
},
)

Expand Down