Skip to main content

Spatial image analysis with caffe and pytorch backends.

Project description


Build Status PyPI version

This repository provide utilities to extract features from random point locations in images and then training classifiers over those features. It is used in the vision backend of

Spacer currently supports python >=3.5.


Spacer executes tasks as defined in messages. The messages types are defined in and the tasks in We also define several data-types in which define input and output types.

Refer to the unit-test in for examples on how to create tasks.

Tasks can be executed directly by calling the methods in However, spacer also supports an interface with SQS handled by sqs_fetch() in

Spacer supports four storage types: s3, filesystem, memory and url. Refer to for details. The Memory storage is mostly used for testing, and the url storage is read only.

Also take a look at for settings and configuration.


The spacer repo can be installed in three ways.

  • Using Docker -- the only option that supports Caffe.
  • Local clone -- ideal for testing and development.
  • Using pip install -- for integration in other code-bases.


Spacer needs three variables. They can either be set as environmental variables (recommended if you pip install the package), or in a secrets.json file in the same directory as this README (recommended for Docker builds and local clones). The secrets.json should look like this.

  "SPACER_LOCAL_MODEL_PATH": "/path/to/your/local/models"

Docker build

The docker build is the preferred build and the one used in deployment.

  • Install docker on your system
  • Create secrets.json as detailed above.
  • Create folder /path/to/your/local/models for caching model files.
  • Build image: docker build -t spacer:test .
  • Run: docker run -v /path/to/your/local/models:/workspace/models -v ${PWD}:/workspace/spacer/ -it spacer:test

The -v /path/to/your/local/models:/workspace/models part will make sure the downloaded models are cached to your host storage. which makes rerunning stuff much faster.

The -v ${PWD}:/workspace/spacer/ mounts your current folder including secrets.json so that the container has the right permissions.

The last step will run the default CMD command specified in the dockerfile (unit-test with coverage). If you want to enter the docker container run the same command but append bash in the end:

Pip install

  • pip install spacer
  • Set environmental variables.

Local clone

  • Clone this repo
  • pip install -r requirements.txt

Code coverage

If you are using the docker build or local install, you can check code coverage like so:

    coverage run --source=spacer --omit=spacer/tests/* -m unittest    
    coverage report -m
    coverage html

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyspacer-0.3.1.tar.gz (28.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page