RoofSegmentation2 / README.md
Deagin's picture
Fix: Bump Gradio to 5.50.0 for huggingface_hub compatibility
b0559d0
---
title: RoofSight
emoji: "\U0001F3E0"
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.50.0
python_version: "3.11"
app_file: app.py
pinned: false
models:
- nvidia/C-RADIOv4-H
---
# RoofSight — Roof Plane Segmentation
Extract individual roof plane polygons from satellite imagery as georeferenced GeoJSON.
## How It Works
1. **Google Solar API** fetches high-resolution RGB imagery, building mask, and Digital Surface Model (DSM) at 0.1 m/pixel.
2. **RANSAC 3D plane fitting** detects geometric roof planes from the DSM point cloud — completely shadow-invariant.
3. **C-RADIOv4-H** (NVIDIA, 631M params) provides zero-shot appearance-based segmentation using DINOv3 + SAM3 + SigLIP2 features distilled into one backbone.
4. **Fusion** merges geometry (RANSAC) with appearance (RADIO) for accurate plane boundaries.
5. **GeoJSON export** with per-plane pitch, azimuth, and area.
## Requirements
- Google Cloud API key with Solar API + Geocoding API enabled.
## Usage
Enter a property address and click **Segment Roof**. The app will:
- Download satellite imagery from Google Solar API
- Isolate the primary building
- Fit 3D planes to the roof surface
- Run zero-shot segmentation for visual refinement
- Output a downloadable GeoJSON file
## Architecture
```
Address -> Geocode -> Google Solar API (RGB + Mask + DSM)
-> Building Isolation -> RANSAC Planes + C-RADIOv4-H
-> Fusion -> GeoJSON Polygons
```
| Module | Purpose |
|--------|---------|
| `google_solar.py` | API calls, GeoTIFF parsing |
| `building.py` | Building isolation, cropping |
| `ransac_planes.py` | 3D plane fitting, DSM upscaling |
| `radio_backbone.py` | C-RADIOv4-H model, zero-shot segmentation |
| `fusion.py` | Geometry + appearance merge |
| `geo_export.py` | GeoJSON polygon extraction |
| `pipeline.py` | Orchestration |
| `app.py` | Gradio UI |