prithivMLmods commited on
Commit
b05e876
·
verified ·
1 Parent(s): d555e36

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -0
README.md CHANGED
@@ -2,8 +2,24 @@
2
  license: apache-2.0
3
  datasets:
4
  - jonathan-roberts1/RSI-CB256
 
 
 
 
 
 
 
 
 
 
5
  ---
6
 
 
 
 
 
 
 
7
  ```py
8
  Classification Report:
9
  precision recall f1-score support
@@ -22,3 +38,90 @@ construction land 0.9945 0.9963 0.9954 3791
22
  ```
23
 
24
  ![download.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/TK92T1T135eFWucPmTGqw.png)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  datasets:
4
  - jonathan-roberts1/RSI-CB256
5
+ language:
6
+ - en
7
+ base_model:
8
+ - google/siglip-base-patch16-224
9
+ pipeline_tag: image-classification
10
+ library_name: transformers
11
+ tags:
12
+ - Remote Sensing Instruments
13
+ - RSI
14
+ - Location
15
  ---
16
 
17
+ ![4.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/6wc37VzmAH_l6nJ2YmV_D.png)
18
+
19
+ # **RSI-CB256-07**
20
+
21
+ > **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-256` using the `SiglipForImageClassification` architecture.
22
+
23
  ```py
24
  Classification Report:
25
  precision recall f1-score support
 
38
  ```
39
 
40
  ![download.png](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/TK92T1T135eFWucPmTGqw.png)
41
+
42
+ ---
43
+
44
+ ## **Label Space: 7 Remote Sensing Classes**
45
+
46
+ This model predicts one of the following categories for a given satellite or aerial image:
47
+
48
+ ```
49
+ Class 0: "transportation"
50
+ Class 1: "other objects"
51
+ Class 2: "woodland"
52
+ Class 3: "water area"
53
+ Class 4: "other land"
54
+ Class 5: "cultivated land"
55
+ Class 6: "construction land"
56
+ ```
57
+
58
+ ---
59
+
60
+ ## **Install Dependencies**
61
+
62
+ ```bash
63
+ pip install -q transformers torch pillow gradio
64
+ ```
65
+
66
+ ---
67
+
68
+ ## **Inference Code**
69
+
70
+ ```python
71
+ import gradio as gr
72
+ from transformers import AutoImageProcessor, SiglipForImageClassification
73
+ from PIL import Image
74
+ import torch
75
+
76
+ # Load model and processor
77
+ model_name = "prithivMLmods/RSI-CB256-07"
78
+ model = SiglipForImageClassification.from_pretrained(model_name)
79
+ processor = AutoImageProcessor.from_pretrained(model_name)
80
+
81
+ # ID to label mapping
82
+ id2label = {
83
+ "0": "transportation",
84
+ "1": "other objects",
85
+ "2": "woodland",
86
+ "3": "water area",
87
+ "4": "other land",
88
+ "5": "cultivated land",
89
+ "6": "construction land"
90
+ }
91
+
92
+ def classify_rsi_image(image):
93
+ image = Image.fromarray(image).convert("RGB")
94
+ inputs = processor(images=image, return_tensors="pt")
95
+
96
+ with torch.no_grad():
97
+ outputs = model(**inputs)
98
+ logits = outputs.logits
99
+ probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()
100
+
101
+ prediction = {
102
+ id2label[str(i)]: round(probs[i], 3) for i in range(len(probs))
103
+ }
104
+
105
+ return prediction
106
+
107
+ # Gradio Interface
108
+ iface = gr.Interface(
109
+ fn=classify_rsi_image,
110
+ inputs=gr.Image(type="numpy"),
111
+ outputs=gr.Label(num_top_classes=7, label="Predicted Land-Cover Category"),
112
+ title="RSI-CB256-07",
113
+ description="Upload a satellite or aerial image to classify it into one of seven coarse land-cover classes using SigLIP2."
114
+ )
115
+
116
+ if __name__ == "__main__":
117
+ iface.launch()
118
+ ```
119
+
120
+ ---
121
+
122
+ ## **Applications**
123
+
124
+ * **Urban vs Rural Segmentation**
125
+ * **Land-Use Classification**
126
+ * **National/Regional Land Cover Monitoring**
127
+ * **Environmental Impact Assessment**