This is the main repository of AP Latam project.
For more information on the website frontend, see the repository at https://github.com/dymaxionlabs/ap-latam-web.
- Python 3+
- Dependencies for TensorFlow with GPU support
Quick install and usage: Docker image
If you have Docker installed on your machine, with NVIDIA CUDA installed and configured, you can simply pull our image and run the scripts for training and detection.
Otherwise, follow the steps in this
to install Docker, CUDA and
nvidia-docker. This has been tested on an Ubuntu
16.04 LTS instance on Google Cloud Platform.
For all scripts you will need to mount a data volume so that the scripts can read the input rasters and vector files, and write the resulting vector file.
It is recommended that you first set an environment variable that points to the data directory in your host machine, like this:
Then, to use any of the scripts, you would have to run them using
nvidia-docker and mounting a volume to
$APLATAM_DATA like this:
nvidia-docker run -ti -v $APLATAM_DATA:/data dymaxionlabs/ap-latam SCRIPT_TO_RUN [ARGS...]
SCRIPT_TO_RUN is either
command line arguments of the specified script. You can run with
see all available options on each script.
For example, suppose you have the following files inside the
- Training rasters on
- A settlements vector file
To prepare a dataset and train a model you would run:
nvidia-docker run -ti -v $APLATAM_DATA:/data dymaxionlabs/ap-latam \ ap_train /data/images /data/settlements.geojson /data/dataset
[nvidia-]docker run for the first time, it will pull the image
automatically for you, so it is not neccessary to do
You can also use
run_with_docker.sh to do the same:
export APLATAM_DATA=$HOME/data/ ./run_with_docker.sh ap_train /data/images /data/settlements.geojson /data/dataset ...
First you will need to install the following packages. On Debian-based distros run:
sudo apt install libproj-dev gdal-bin build-essential libgdal-dev libspatialindex-dev python3-venv virtualenv
Clone the repository and run
python setup.py install to install the package
with its dependencies. Add
--extras gpu to install GPU dependencies
(TensorFlow for GPUs).
make to run tests and
make cov to build a code coverage report. You can
make to do both.
Please report any bugs and enhancement ideas using the GitHub issue tracker:
Feel free to also ask questions on our Gitter channel, or by email.
Any help in testing, development, documentation and other tasks is highly appreciated and useful to the project.
For more details, see the file CONTRIBUTING.md.
Source code is released under a BSD-2 license. Please refer to LICENSE.md for more information.