Spaces:
Running on Zero
Running on Zero
File size: 8,884 Bytes
3d04148 9fd4f34 3d04148 9fd4f34 3d04148 9fd4f34 edf7ac3 3d04148 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 4fbb159 e00e6a7 4fbb159 e00e6a7 4fbb159 e00e6a7 4fbb159 e00e6a7 4fbb159 e00e6a7 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 edf7ac3 9fd4f34 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | ---
title: Satellite Vision Toolkit
emoji: π°οΈ
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.49.1
python_version: "3.11"
app_file: app.py
pinned: false
license: mit
short_description: LULC classification, segmentation, and object detection.
---
<div align="center">
# π°οΈ Satellite Vision Toolkit
### Professional scene, pixel, and object-level analysis for overhead imagery
[](https://huggingface.co/spaces/Mingze/SatelliteVisionToolkit)
[](https://huggingface.co/bluelabel/satellite-equipment-detection-yolov8n-vhr10)
[](https://huggingface.co/mfaytin/mask2former-satellite)
[](https://huggingface.co/mrm8488/convnext-tiny-finetuned-eurosat)
[](LICENSE)
**Upload one satellite or aerial image, run a multi-model assessment, and download reusable visual and machine-readable evidence.**
[**π Launch the live app**](https://huggingface.co/spaces/Mingze/SatelliteVisionToolkit) Β·
[**π» GitHub source**](https://github.com/LabMingzeChen/SatelliteVisionToolkit)
</div>
## What it does
The app provides three complementary analytical levels plus a one-click combined workflow:
| Mode | Model | Output vocabulary |
|---|---|---|
| Scene-level LULC classification | ConvNeXT-Tiny fine-tuned on EuroSAT | annual crop, forest, herbaceous vegetation, highway, industrial, pasture, permanent crop, residential, river, sea/lake |
| Object detection | YOLOv8n fine-tuned on NWPU VHR-10 | airplane, ship, storage tank, baseball diamond, tennis court, basketball court, ground track field, harbor, bridge, vehicle |
| Land-cover segmentation | Mask2Former fine-tuned on OpenEarthMap | background, bare land, grass, pavement, road, tree, water, cropland, building |
Every run creates visual and machine-readable outputs:
- Ranked LULC probabilities, a confidence tier, normalized entropy, and CSV/JSON exports.
- Detection overlay, per-class summary, per-object CSV, and pixel-coordinate GeoJSON.
- Land-cover overlay, categorical mask, raw class-ID PNG, and class-area CSV.
- A professional executive dashboard and complete JSON evidence package.
- Independent Gradio API endpoints at `/classify`, `/segment`, `/detect`, and `/analyze`.
- A reusable Codex skill and command-line Space client.
## Urban sample scenes
The interface includes four visible, one-click urban chips from the [UC Merced Land Use dataset](https://huggingface.co/datasets/blanchon/UC_Merced). Each is a 256Γ256 RGB aerial image at approximately 0.3 m spatial resolution, derived from USGS National Map Urban Area Imagery.
| Case | Urban features | Suggested use |
|---|---|---|
| Dense residential | roofs, streets, impervious surfaces | Review residential LULC confidence and building/pavement segmentation |
| Urban intersection | road markings, pavement, small vehicles | Test road segmentation and the limits of small-object detection |
| Marina / harbor | water, docks, tightly spaced boats | Compare water cover with ship/harbor predictions |
| Parking lot | pavement and tightly packed vehicles | Probe pavement share and vehicle detection sensitivity |
These images are method-exploration examples, not ground-truth demonstrations. Their sub-meter aerial scale differs substantially from the EuroSAT classifier's Sentinel-2 training domain, so classification results should be interpreted as domain-shifted hypotheses.
## How it works
```text
Satellite or aerial RGB image
βββ ConvNeXT-Tiny / EuroSAT
β βββ ranked scene-level LULC probabilities
β βββ normalized uncertainty (entropy)
β βββ classification CSV + JSON
β
βββ YOLOv8n / NWPU VHR-10
β βββ labeled bounding-box overlay
β βββ class counts and confidence
β βββ per-object CSV
β βββ image-pixel GeoJSON
β
βββ Mask2Former / OpenEarthMap
βββ land-cover overlay
βββ categorical color mask
βββ raw class-ID PNG
βββ per-class pixel-share CSV
```
Images are orientation-corrected, converted to RGB, and bounded to 2048 pixels on their longest side. The first request downloads the public model weights; later requests reuse the container cache. CUDA is used when available and CPU remains supported.
## Run locally
```bash
git clone https://github.com/LabMingzeChen/SatelliteVisionToolkit.git
cd SatelliteVisionToolkit
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.py
```
Open the local Gradio URL. PNG, JPEG, WebP, and RGB TIFF inputs work best.
## Call the Hugging Face API
```python
from gradio_client import Client, handle_file
client = Client("Mingze/SatelliteVisionToolkit")
classification = client.predict(
handle_file("satellite.jpg"),
5,
api_name="/classify",
)
detection = client.predict(
handle_file("satellite.jpg"),
0.25,
0.45,
api_name="/detect",
)
segmentation = client.predict(
handle_file("satellite.jpg"),
0.55,
0.10,
api_name="/segment",
)
complete = client.predict(
handle_file("satellite.jpg"),
5, 0.55, 0.10, 0.25, 0.45,
api_name="/analyze",
)
```
The bundled CLI wraps the same endpoints:
```bash
python scripts/satellite_client.py classify satellite.jpg --output classification.json
python scripts/satellite_client.py detect satellite.jpg --output detection.json
python scripts/satellite_client.py segment satellite.jpg --output segmentation.json
python scripts/satellite_client.py analyze satellite.jpg --output complete.json
```
## Project structure
```text
SatelliteVisionToolkit/
βββ app.py Gradio UI and inference workflows
βββ satellite_utils.py Rendering, summaries, CSV, and GeoJSON exports
βββ scripts/satellite_client.py
βββ tests/ Lightweight deterministic tests
βββ skills/ Reusable Codex workflow
βββ .codex-plugin/plugin.json Codex plugin manifest
```
## Models, data, and licensing
The application code is MIT licensed. Model software, weights, and training data keep their own terms.
| Resource | Role | Terms noted by source |
|---|---|---|
| [`mrm8488/convnext-tiny-finetuned-eurosat`](https://huggingface.co/mrm8488/convnext-tiny-finetuned-eurosat) | Scene-level LULC classifier | Model card lists Apache-2.0 |
| [EuroSAT](https://huggingface.co/datasets/GFM-Bench/EuroSAT) | LULC classification dataset | Review dataset terms and cite Helber et al. |
| [`bluelabel/satellite-equipment-detection-yolov8n-vhr10`](https://huggingface.co/bluelabel/satellite-equipment-detection-yolov8n-vhr10) | Remote-sensing object detector | Model card lists MIT; Ultralytics runtime has separate licensing |
| [NWPU VHR-10](https://gcheng-nwpu.github.io/#Datasets) | Detection training dataset | Review dataset terms and cite its authors |
| [`mfaytin/mask2former-satellite`](https://huggingface.co/mfaytin/mask2former-satellite) | Land-cover segmentation model | Model card lists MIT |
| [OpenEarthMap](https://open-earth-map.org/) | Segmentation training dataset | Review dataset terms and cite Xia et al. |
## Limitations and responsible use
- Results vary with spatial resolution, sensor, geography, season, atmospheric conditions, shadows, and image preprocessing.
- EuroSAT classification is a whole-scene hypothesis learned from small European Sentinel-2 RGB tiles; it is not parcel delineation, zoning, cadastral, or legal land-use evidence.
- Review ranked alternatives and normalized entropy. A confident prediction can still be wrong under domain shift.
- Small objects may disappear during resizing or fall below the confidence threshold.
- Detection counts describe visible predictions, not complete inventories.
- Segmentation shares describe processed image pixels, not surveyed ground area.
- Exported GeoJSON uses top-left-origin image pixels and has no geographic CRS. It must not be overlaid on a map as if it were georeferenced.
- Do not use predictions alone for navigation, legal boundaries, surveillance, military targeting, emergency response, or other safety-critical decisions.
- Avoid uploading private or sensitive imagery to a public Space.
## Citation
```bibtex
@software{chen2026satellitevisiontoolkit,
author = {Chen, Mingze},
title = {Satellite Vision Toolkit},
year = {2026},
url = {https://github.com/LabMingzeChen/SatelliteVisionToolkit}
}
```
Please also cite NWPU VHR-10, OpenEarthMap, YOLO/Ultralytics, and Mask2Former as applicable.
|