City-wide perceptions of neighbourhood quality using street-view images: a methodological toolkit
Description
We provide all the necessary components to launch your own urban perceptions survey using street view images. This work is part of Emily Muller's PhD funded by the MRC Center for Environment & Health.
System Requirements
Program | Version |
---|---|
Python | >= 3.7 |
QGIS | >= 3.14.1-Pi |
GNU parallel | |
Postgresql | >= 11.17 |
Node.js | >= 16.13.2 |
Docker | >= 20.10.18 |
kubectl | ==v1.20.2 |
wandb |
Python and npm modules are included in requirement.txt files.
How to Use this Repository
This repository has 3 core components:
Title | Description | Location | Key Components Objectives |
---|---|---|---|
Introduction to Environmental Health and Imagery | This is a short video, introducing the domain, methods and describing some pioneering work in this field | Video | Introduction to the field. Understand different methods. Understand different types of data. Be aware of seminal research. |
download_images |
This repository contains all the code needed to download google street view images. | download_images | Get all available images from Google Street View. Select images to download. |
web_app |
This repository contains all the code needed to build a web-app to survey user pairwise image ratins. | web_app | Build database, back-end and front-end. Dockerise and host using kubernetes. |
deep_cnn |
This module contains all the code needed to fine-tune a deep neural network. | deep_cnn | Use terminal for executing python scripts Train a PyTorch model and visualise results. Implement bash script. Iterate on model hyperparameters to optimise model. |
Getting started
Clone this repository into your local drive.
git clone https://github.com/emilymuller1991/urban-perceptions.git
cd urban-perceptions
Setting up a virtual environment
We will set up a virtual environment for running our scripts. In this case, installing specific package versions will not interfere with other programmes we run locally as the environment is contained. Initially, let's set up a virtual environment:
virtualenv --python=python3.7 venv
This will create a new folder for the virtual environment named venv` in your repository. We activate this environment by running
source venv/bin/activate
We install dependencies by running
pip install requirements.txt
Note this will only install python dependencies. We will also need other software utilies at various stages throughout this procotol.
Setting up the development virtual environment
The pytest
and pre-commit module is required for running tests and formatting. This can be installed by running:
pip install requirements_dev.txt
Now run the tests below to make sure everything is set up correctly. Then, proceed to the video.
Testing
To run all tests, install pytest
. After installing, run
pytest tests/ -v