CoolFace
Modelpublic

Sathya77/swin-transformer-satellite

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
Model Card

Swin Transformer — Satellite Image Classification

PyTorch implementation of Swin Transformer (Liu et al. 2021) trained on NWPU-RESISC45 satellite imagery dataset.

Model Details

PropertyValue
ArchitectureSwin Transformer (4 stages)
DatasetNWPU-RESISC45
Classes45 land use categories
Test Accuracy82%
Input Size224×224
Embed Dim96
Training HardwareRTX 4050 6GB
FrameworkPyTorch (from scratch)

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

python
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