Skip to main content

A package for universal urban analysis

Project description

UrbanCode (v0.2.1)

A Python package for street view image perception analysis, providing tools for feature extraction and comfort prediction.

Related Research

Thermal Comfort in Sight: Thermal Affordance and Its Visual Assessment

Features

Street View Image (SVI) Analysis

  • Semantic segmentation
  • Object detection
  • Color feature extraction
  • Scene recognition
  • Perception analysis (thermal_comfort, visual_comfort, safety, etc.)

Examples

1. Street View Image Feature Extraction

examples/test_svi_image_feature.ipynb

  • Demonstrates how to extract various features from street view images
  • Includes semantic segmentation, object detection, color analysis, and scene recognition
  • Shows how to process multiple images and save results

2. Street View Image Comfort Prediction

examples/test_svi_comfort_prediction.ipynb

  • Shows how to predict comfort scores from street view images
  • Demonstrates the use of the comfort function for both single images and folders
  • Includes visualization of perception metrics
  • Automatically normalizes perception scores to 0-5 range

Installation

pip install urbancode

Usage

Feature Extraction

import urbancode as uc
import pandas as pd

# Process a folder of images
df = uc.svi.filename("path/to/folder")
df = uc.svi.segmentation(df, folder_path="path/to/folder")
df = uc.svi.object_detection(df, folder_path="path/to/folder")
df = uc.svi.color(df, folder_path="path/to/folder")
df = uc.svi.scene_recognition(df, folder_path="path/to/folder")

# Save results
df.to_csv("svi_results.csv", index=False)

Comfort Prediction

import urbancode as uc

# Process a single image
df = uc.svi.comfort("path/to/image.jpg", mode='image')

# Process a folder of images
df = uc.svi.comfort("path/to/folder", mode='folder')

# Save results
df.to_csv("comfort_results.csv", index=False)

Perception Metrics

The comfort function returns a DataFrame with the following perception metrics (normalized to 0-5 range):

  • thermal_comfort
  • visual_comfort
  • temp_intensity
  • sun_intensity
  • humidity_inference
  • wind_inference
  • traffic_flow
  • greenery_rate
  • shading_area
  • material_comfort
  • imageability
  • enclosure
  • human_scale
  • transparency
  • complexity
  • safe
  • lively
  • beautiful
  • wealthy
  • boring
  • depressing

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

urbancode-0.2.1.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

urbancode-0.2.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file urbancode-0.2.1.tar.gz.

File metadata

  • Download URL: urbancode-0.2.1.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for urbancode-0.2.1.tar.gz
Algorithm Hash digest
SHA256 14b30b9dd0b8c4a7fbe2632df4b3f8b8cc8530f187580520dbc599bad9631e1a
MD5 2d8d8c30219ce3971428ec90e8531444
BLAKE2b-256 b6fda7a3741d4eca9293b7ab26fb876e94af5888ccb2ddcb4f0ab222687dcdb9

See more details on using hashes here.

File details

Details for the file urbancode-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: urbancode-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for urbancode-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2be7e263efdca9a77c994c14e954bc38afbe206933756af53a1984d151ab35f4
MD5 e4c60d12823666cfe25ac9cb833c055d
BLAKE2b-256 6864895b8db779005131fd3fd5d1a1a80d55e3da3f634e311156682494eb04c6

See more details on using hashes here.

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