Sathya77/swin-transformer-satellite
0
Swin Transformer — Satellite Image Classification
PyTorch implementation of Swin Transformer (Liu et al. 2021) trained on NWPU-RESISC45 satellite imagery dataset.
Model Details
Classes
airplane, airport, baseballdiamond, basketballcourt, beach, bridge, chaparral, church, circularfarmland, cloud, commercialarea, denseresidential, desert, forest, freeway, golfcourse, groundtrackfield, harbor, industrialarea, intersection, island, lake, meadow, mediumresidential, mobilehomepark, mountain, overpass, palace, parkinglot, railway, railwaystation, rectangularfarmland, river, roundabout, runway, seaice, ship, snowberg, sparseresidential, stadium, storagetank, tenniscourt, terrace, thermalpower_station, wetland
Usage
from huggingface_hub import hf_hub_download
import torch
from torchvision import transforms
from PIL import Image
checkpoint = torch.load(
hf_hub_download("Sathya77/swin-transformer-satellite", "swin_resisc45.pth"),
map_location='cpu'
)
model = SwinTransformer(embed_dim=96, num_classes=45)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()Live Demo
Try it here: Sathya77/swin-transformer-satellite
References
- Swin Transformer Paper — Liu et al. 2021
- NWPU-RESISC45 Dataset
