Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f330dc8

Browse files
committed
Update examples & perception calculation.
1 parent c66cd76 commit f330dc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+480
-751
lines changed

.DS_Store

0 Bytes
Binary file not shown.

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,23 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
## [0.1.1] - 2024-01-15
5+
## [0.2.1] - 2025-04-17
6+
7+
### Added
8+
- Added normalization of perception scores to 0-5 range when processing multiple images
9+
- Improved comfort function to automatically scale perception metrics
10+
11+
## [0.2.0] - 2025-04-17
12+
13+
### Changed
14+
- Reorganized perception module into SVI module for better structure
15+
- Updated version number consistency across the package
16+
17+
### Fixed
18+
- Removed redundant perception module
19+
- Fixed package structure in PyPI distribution
20+
21+
## [0.1.1] - 2025-01-15
622

723
### Added
824
- Added Street View Image (SVI) feature extraction functionality

README.md

Lines changed: 93 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,93 @@
1-
# Urban-Code
2-
## Package Structure
3-
urbancode/
4-
├── urbancode/
5-
│ ├── __init__.py
6-
│ └── network/
7-
│ ├── tests/
8-
│ │ ├── __init__.py
9-
│ │ ├── test_core.py
10-
│ │ ├── test_connectivity.py
11-
│ │ ├── test_centrality.py
12-
│ │ ├── test_utils.py
13-
│ │ └── test_visualization.py
14-
│ ├── __init__.py
15-
│ ├── core.py
16-
│ ├── connectivity.py
17-
│ ├── centrality.py
18-
│ ├── visualization.py
19-
│ └── utils.py
20-
├── examples/
21-
│ └── urban network analytics.ipynb
22-
├── README.md
23-
├── LICENSE
24-
├── setup.py
25-
├── requirements.txt
26-
└── .gitignore
1+
# UrbanCode (v0.2.1)
2+
3+
A Python package for street view image perception analysis, providing tools for feature extraction and comfort prediction.
4+
5+
## Related Research
6+
7+
[Thermal Comfort in Sight: Thermal Affordance and Its Visual Assessment](https://github.com/Sijie-Yang/Thermal-Affordance)
8+
9+
## Features
10+
11+
### Street View Image (SVI) Analysis
12+
- Semantic segmentation
13+
- Object detection
14+
- Color feature extraction
15+
- Scene recognition
16+
- Perception analysis (thermal_comfort, visual_comfort, safety, etc.)
17+
18+
## Examples
19+
20+
### 1. Street View Image Feature Extraction
21+
`examples/test_svi_image_feature.ipynb`
22+
- Demonstrates how to extract various features from street view images
23+
- Includes semantic segmentation, object detection, color analysis, and scene recognition
24+
- Shows how to process multiple images and save results
25+
26+
### 2. Street View Image Comfort Prediction
27+
`examples/test_svi_comfort_prediction.ipynb`
28+
- Shows how to predict comfort scores from street view images
29+
- Demonstrates the use of the comfort function for both single images and folders
30+
- Includes visualization of perception metrics
31+
- Automatically normalizes perception scores to 0-5 range
32+
33+
## Installation
34+
35+
```bash
36+
pip install urbancode
37+
```
38+
39+
## Usage
40+
41+
### Feature Extraction
42+
```python
43+
import urbancode as uc
44+
import pandas as pd
45+
46+
# Process a folder of images
47+
df = uc.svi.filename("path/to/folder")
48+
df = uc.svi.segmentation(df, folder_path="path/to/folder")
49+
df = uc.svi.object_detection(df, folder_path="path/to/folder")
50+
df = uc.svi.color(df, folder_path="path/to/folder")
51+
df = uc.svi.scene_recognition(df, folder_path="path/to/folder")
52+
53+
# Save results
54+
df.to_csv("svi_results.csv", index=False)
55+
```
56+
57+
### Comfort Prediction
58+
```python
59+
import urbancode as uc
60+
61+
# Process a single image
62+
df = uc.svi.comfort("path/to/image.jpg", mode='image')
63+
64+
# Process a folder of images
65+
df = uc.svi.comfort("path/to/folder", mode='folder')
66+
67+
# Save results
68+
df.to_csv("comfort_results.csv", index=False)
69+
```
70+
71+
### Perception Metrics
72+
The comfort function returns a DataFrame with the following perception metrics (normalized to 0-5 range):
73+
- thermal_comfort
74+
- visual_comfort
75+
- temp_intensity
76+
- sun_intensity
77+
- humidity_inference
78+
- wind_inference
79+
- traffic_flow
80+
- greenery_rate
81+
- shading_area
82+
- material_comfort
83+
- imageability
84+
- enclosure
85+
- human_scale
86+
- transparency
87+
- complexity
88+
- safe
89+
- lively
90+
- beautiful
91+
- wealthy
92+
- boring
93+
- depressing

build/lib/urbancode/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
__version__ = "0.1.0"
22
__author__ = "Sijie Yang"
3-
__description__ = "A package for universal urban analysis"
3+
__description__ = "A package for universal urban analysis"
4+
5+
# Import submodules
6+
from . import svi
7+
8+
# Make svi module available at package level
9+
__all__ = ['svi']
10+
11+
# Remove the direct imports

0 commit comments

Comments
 (0)