Skip to content

ViT-DINO small patch Sentinel-2 Embeddings #13

@cr458

Description

@cr458

Alabama, Java, Bali

import torch
from torchgeo.models import vit_small_patch16_224, ViTSmall16_Weights

weights = ViTSmall16_Weights.SENTINEL2_ALL_DINO
transforms = weights.transforms
model = vit_small_patch16_224(weights=weights, num_classes=0, img_size=224)
model.eval()

with torch.inference_mode():
    x = torch.randn(1, weights.meta["in_chans"], 224, 224)
    print(model(x).shape) # (1, 384)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions