Skip to main content

Computer vision library for extracting 43+ building properties from street view images and footprints

Project description

imageable

Tests PyPI version Python 3.13+ License: MIT

An open-source Python library for extracting 43+ building properties from street view images and building footprints. Designed for urban planners, architects, climate resilience researchers, and GIS professionals.

Imageable

Features

  • Height Estimation: Estimate building heights from single street-level images using vanishing point detection and semantic segmentation
  • Material Analysis: Segment and quantify façade materials (brick, glass, concrete, etc.)
  • Footprint Properties: Extract 21 geometric, engineered, and contextual features from building polygons
  • Image Features: Analyze color, shape, and façade characteristics from street view images
  • Batch Processing: Process entire neighborhoods via GeoDataFrames or GeoJSON files

Installation

pip install urban-imageable

For Development

# Clone the repository
git clone https://github.com/scalable-design-participation-lab/imageable.git
cd imageable

# Install with uv (recommended)
uv sync --group dev

Quick Start

Single Building Analysis

import imageable
from shapely.geometry import Polygon

# Define building footprint (WGS84 coordinates)
footprint = Polygon([
    (-71.0589, 42.3601),
    (-71.0585, 42.3601),
    (-71.0585, 42.3605),
    (-71.0589, 42.3605),
])

# Get street view image
image, metadata = imageable.get_image(api_key, footprint)

# Extract all 43+ properties
props = imageable.get_dataset(api_key, footprint)
print(f"Estimated height: {props.building_height}m")
print(f"Projected area: {props.projected_area}m²")
print(f"Shape complexity: {props.complexity}")

Batch Processing from GeoDataFrame

import geopandas as gpd
import imageable

# Load building footprints
gdf = gpd.read_file("buildings.geojson")

# Extract properties for all buildings
result = imageable.get_building_data_from_gdf(
    gdf,
    api_key,
    id_column="building_id",
    neighbor_radius=100.0,  # meters
    verbose=True,
)

# Result is a GeoDataFrame with 43+ new columns
print(result.columns)

From GeoJSON File

import imageable

# Process directly from GeoJSON
result = imageable.get_building_data_from_geojson(
    "buildings.geojson",
    api_key,
    output_format="gdf",  # or "geojson", "dict"
)

With Pre-downloaded Images

import imageable

# Process from local footprints and images
result = imageable.get_building_data_from_file(
    "footprints.geojson",
    "images/",  # Directory containing images named by building ID
    id_column="building_id",
)

Extracted Properties

Footprint Properties (21 features)

Geometric (6):

  • unprojected_area, projected_area: Area in original and projected CRS
  • longitude_difference, latitude_difference: Bounding box dimensions
  • n_vertices: Number of polygon vertices
  • shape_length: Perimeter length

Engineered (5):

  • complexity: Perimeter/area ratio
  • inverse_average_segment_length: Edge length metric
  • vertices_per_area: Vertex density
  • average_complexity_per_segment: Segment-level complexity
  • isoperimetric_quotient: Circularity measure (4πA/P²)

Contextual (10):

  • neighbor_count: Number of buildings within radius
  • mean_distance_to_neighbors: Average centroid distance
  • nearest_neighbor_distance: Distance to closest building
  • n_size_mean/std/min/max/cv: Neighbor area statistics
  • expected_nearest_neighbor_distance: Random distribution expectation
  • nni: Nearest neighbor index

Height Estimation

  • building_height: Estimated height in meters using CV pipeline (vanishing points + segmentation)

Image Features (16 features)

Color (5):

  • average_red/green/blue_channel_value: RGB means
  • average_brightness: HSV brightness percentage
  • average_vividness: HSV saturation percentage

Shape (5):

  • mask_area: Segmented building pixels
  • mask_length: Boundary perimeter
  • mask_complexity: Length/area ratio
  • number_of_edges, number_of_vertices: Polygon complexity

Façade (6):

  • average_window_x/y: Window centroid location
  • average_door_x/y: Door centroid location
  • number_of_windows, number_of_doors: Element counts

Material Percentages

  • material_percentages: Dictionary of façade material coverage (brick, glass, concrete, metal, etc.)

API Reference

Main Functions

# Batch processing
imageable.get_building_data_from_gdf(gdf, api_key, ...)
imageable.get_building_data_from_geojson(source, api_key, ...)
imageable.get_building_data_from_file(footprints, images_dir, ...)

# Single building
imageable.get_dataset(api_key, footprint, ...)
imageable.get_image(api_key, footprint, ...)

# Data class
imageable.BuildingProperties

BuildingProperties

from imageable import BuildingProperties

# Create and populate
props = BuildingProperties(building_id="b001")
props.update_footprint_features(footprint_dict)
props.update_height(25.5)
props.update_material_percentages({"brick": 60.0, "glass": 40.0})

# Export
props.to_dict()  # Dictionary
props.to_json("output.json")  # JSON file
props.get_feature_vector()  # NumPy array for ML

# Import
props = BuildingProperties.from_dict(data)
props = BuildingProperties.from_json("input.json")

Requirements

  • Python 3.13+
  • Google Street View API key (for image acquisition and height estimation)
  • See pyproject.toml for full dependency list

Development

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov-report=html
open htmlcov/index.html

# Lint and format
uv run pre-commit run --all-files

# Build package
uv build

Project Structure

imageable/
├── src/imageable/
│   ├── core/              # Public API
│   │   ├── building_data.py   # Batch processing
│   │   ├── dataset.py         # Single building extraction
│   │   └── image.py           # Image acquisition
│   ├── _extraction/       # Property extraction
│   │   ├── building.py        # BuildingProperties dataclass
│   │   ├── extract.py         # Main orchestrator
│   │   ├── footprint.py       # Footprint features
│   │   └── image.py           # Image features
│   ├── _features/         # Feature pipelines
│   │   ├── height/            # Height estimation
│   │   └── materials/         # Material segmentation
│   ├── _images/           # Image acquisition
│   │   ├── camera/            # Camera parameters
│   │   └── download.py        # Street View API
│   └── _models/           # ML models
│       ├── huggingface/       # SegFormer segmentation
│       ├── lcnn/              # Line detection
│       └── vpts/              # Vanishing points
└── tests/                 # Test suite

Citation

If you use imageable in your research, please cite:

@software{imageable2025,
  author = {Ngo, Khoi and Legaria, Uriel and Sandoval Olascoaga, Carlos},
  title = {imageable: Computer Vision Library for Urban Building Analysis},
  year = {2025},
  url = {https://github.com/scalable-design-participation-lab/imageable}
}

License

MIT License - see LICENSE for details.

Authors

Developed at the Scalable Design Participation Lab, Northeastern University.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urban_imageable-0.1.2.tar.gz (197.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

urban_imageable-0.1.2-py3-none-any.whl (227.7 kB view details)

Uploaded Python 3

File details

Details for the file urban_imageable-0.1.2.tar.gz.

File metadata

  • Download URL: urban_imageable-0.1.2.tar.gz
  • Upload date:
  • Size: 197.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for urban_imageable-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5243d8a004e973c9b8e14fe38bc21609a88aab2a4c5f38c44b39d6fe1f305877
MD5 0b357b6ab444aa59bbb1af2d95f45b3e
BLAKE2b-256 e92596c1be5d54d572d88ce9b85151556b22e7183afa3395eac4281ae8ad9cfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for urban_imageable-0.1.2.tar.gz:

Publisher: ci.yml on scalable-design-participation-lab/imageable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file urban_imageable-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: urban_imageable-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 227.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for urban_imageable-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0033503127faf24e078159347d177947a432011c992bb036ea66efd7f94a5696
MD5 f2654d6ac38a8e66fcd3cce336636d7f
BLAKE2b-256 c823352ecd564a1c041a1e32de589d4dddefcd58a3f7a68c686f45251e99d615

See more details on using hashes here.

Provenance

The following attestation bundles were made for urban_imageable-0.1.2-py3-none-any.whl:

Publisher: ci.yml on scalable-design-participation-lab/imageable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page