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
Metadata
Release files for urbancode 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| urbancode-0.2.3.tar.gz | 20.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| urbancode-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.3 kB
Release files / urbancode-0.2.3.tar.gz
| Download URL | urbancode-0.2.3.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2113f93ebb0b31b067b77534b35ccffc82743c46c3c8498e573a1b449c2a0194
|
|
BLAKE2b-256 checksum How to use checksums |
1279689c286c6cd6c7184946ec242e693a07ba5a3e33bec4e125b0f1a98f4cf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / urbancode-0.2.3-py3-none-any.whl
| Download URL | urbancode-0.2.3-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
73ee99ad7225bf2f537151d214db63eff17df292cab761e7f2b0f47813d71082
|
|
BLAKE2b-256 checksum How to use checksums |
6bf46ce8ccd25a21ec436c69e3587397bc9d90b96cd3f35793331cf764f71f4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|