Downloads · 30 days
0
mdranias1/satellite-building-segmentation
satellite-building-segmentation is a machine learning model from mdranias1. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
A high-performance satellite building segmentation model using enhanced U-Net architecture, achieving 65.62% Mean IoU on the ISPRS Potsdam dataset.
Downloads · 30 days
0
Access
Public
Updated Jul 26, 2025
Repo size
410 MB
Likes
0
Public
Click a slice to open those files.
.bin410 MB · 100%
From the Hugging Face model README
A high-performance satellite building segmentation model using enhanced U-Net architecture, achieving 65.62% Mean IoU on the ISPRS Potsdam dataset.
| Class | IoU | Description |
|---|---|---|
| Impervious | 0.78 | Roads, parking, concrete |
| Buildings | 0.69 | Houses, structures |
| Low Vegetation | 0.65 | Grass, crops, lawns |
| Trees | 0.72 | Forests, large trees |
| Cars | 0.45 | Vehicles |
| Clutter | 0.35 | Mixed/background |
import torch
from PIL import Image
import numpy as np
# Load model
model = torch.load('pytorch_model.bin', map_location='cpu')
model.eval()
# Load and preprocess image
image = Image.open('satellite_image.tif').convert('RGB')
image = image.resize((512, 512))
image_tensor = torch.from_numpy(np.array(image)).float().permute(2, 0, 1) / 255.0
# Normalize
mean = torch.tensor([0.485, 0.456, 0.406]).view(3, 1, 1)
std = torch.tensor([0.229, 0.224, 0.225]).view(3, 1, 1)
image_tensor = (image_tensor - mean) / std
# Predict
with torch.no_grad():
outputs = model(image_tensor.unsqueeze(0))
predictions = torch.argmax(torch.softmax(outputs, dim=1), dim=1)
# Convert to numpy
segmentation = predictions.cpu().numpy()[0]
CLASS_COLORS = {
0: [255, 255, 255], # Impervious (white)
1: [255, 0, 0], # Buildings (red)
2: [0, 255, 0], # Low vegetation (green)
3: [0, 255, 255], # Trees (cyan)
4: [255, 255, 0], # Cars (yellow)
5: [255, 0, 255], # Clutter (magenta)
}
If you use this model in your research, please cite:
@misc{satellite-building-segmentation-2024,
title={Satellite Building Segmentation using Enhanced U-Net},
author={Your Name},
year={2024},
howpublished={Hugging Face Hub},
url={https://huggingface.co/your-username/satellite-building-segmentation}
}
Contributions welcome! Areas for improvement:
MIT License - See LICENSE file for details.