Here we automatically count how many people live in an area in Malawi using Google Maps. Quickly knowing how many people live in an area is important in various circumstances, e.g. distributing medicine or providing help after a natural disaster. But for rural areas this is not always known. The imagery of Google Maps (houses) can be a useful source to quickly get an estimate from a distance.
We first thought we needed to use satellite imagery, but it turns out we can use the map information of the Google Maps API, which already has metal-roofed houses detected pretty accurately for Malawi (see darkgrey squares in map below). We then use the estimate of 4.3 people per house (specific to Malawi) to count the number of people within a given set of coordinates. We estimate around 500 people (exact output: 499) live in the example area below.
The next step would be to investigate how well the common grass-thatched roofs are detected, and improve there.
See Unicef challenge June 2024.
.
based on the satellite imagery below
python entrypoint.py (once you've completed setup below)
conda create --name counting-houses python==3.11 -y
conda activate counting-houses
pip install poetry
poetry install
- Go to the Google Cloud Console.
- Click on "Select a project" and then "New Project".
- Enter the project name and billing account, then click "Create".
- Navigate to the "API & Services" > "Library" in the Google Cloud Console.
- Search for and enable Maps Static API
- Go to "API & Services" > "Credentials".
- Click "Create Credentials" and select "API Key".
- Copy the API key that is generated into a txt file and call it
credentials.txt.
Koen Greuell & Clara Tump
