RSI-CB256-07 is a SigLIP2-based model fine-tuned for coarse-grained remote sensing land-cover classification. It distinguishes among 7 essential categories commonly used in environmental, urban planning, and geospatial analysis applications. The model is built on google/siglip2-base-patch16-224 using the SiglipForImageClassification architecture.
py
1Classification Report:2 precision recall f1-score support
34 transportation 0.98100.98580.983433005 other objects 0.98540.99320.98938846 woodland 0.99730.99580.996662587 water area 0.98700.98370.985441048 other land 0.99250.99190.992235939 cultivated land 0.99180.99010.9909281710construction land 0.99450.99630.995437911112 accuracy 0.99122474713 macro avg 0.98990.99100.99042474714 weighted avg 0.99120.99120.991224747
download.png
Label Space: 7 Remote Sensing Classes
This model predicts one of the following categories for a given satellite or aerial image:
Class 0: "transportation"
Class 1: "other objects"
Class 2: "woodland"
Class 3: "water area"
Class 4: "other land"
Class 5: "cultivated land"
Class 6: "construction land"
Install Dependencies
pip install -q transformers torch pillow gradio
Inference Code
python
1import gradio as gr
2from transformers import AutoImageProcessor, SiglipForImageClassification
3from PIL import Image
4import torch
56# Load model and processor7model_name ="prithivMLmods/RSI-CB256-07"8model = SiglipForImageClassification.from_pretrained(model_name)9processor = AutoImageProcessor.from_pretrained(model_name)1011# ID to label mapping12id2label ={13"0":"transportation",14"1":"other objects",15"2":"woodland",16"3":"water area",17"4":"other land",18"5":"cultivated land",19"6":"construction land"20}2122defclassify_rsi_image(image):23 image = Image.fromarray(image).convert("RGB")24 inputs = processor(images=image, return_tensors="pt")2526with torch.no_grad():27 outputs = model(**inputs)28 logits = outputs.logits
29 probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()3031 prediction ={32 id2label[str(i)]:round(probs[i],3)for i inrange(len(probs))33}3435return prediction
3637# Gradio Interface38iface = gr.Interface(39 fn=classify_rsi_image,40 inputs=gr.Image(type="numpy"),41 outputs=gr.Label(num_top_classes=7, label="Predicted Land-Cover Category"),42 title="RSI-CB256-07",43 description="Upload a satellite or aerial image to classify it into one of seven coarse land-cover classes using SigLIP2."44)4546if __name__ =="__main__":47 iface.launch()