Skip to content

aws-solutions-library-samples/osml-models

OSML Models

This package contains sample models that can be used to test OversightML installations without incurring high compute costs typically associated with complex Computer Vision models. These models implement an interface compatible with SageMaker and are suitable for deployment as endpoints with CPU instances.

Table of Contents

Getting Started

Prerequisites:

First, ensure you have installed the following tools locally

Installation Guide

Clone osml-models package into your desktop

git clone https://github.com/aws-solutions-library-samples/osml-models.git

Documentation

You can find documentation for this library in the ./doc directory. Sphinx is used to construct a searchable HTML version of the API documents.

tox -e docs

Build and Local Testing

To build the container, it uses the default Dockerfile from the root of this repository. If you want to change to another Dockerfile, replace the . with the new Dockerfile path.

docker build . -t osml-models:latest

Note: The MODEL_SELECTION environment variable can be used to pick the model to run. Currently, we support 3 different types of a model and below are the appropriate naming convention:

  • centerpoint
  • flood
  • aircraft

In one terminal, run the following command to start the server:

docker run -p 8080:8080 -e MODEL_SELECTION=${MODEL_SELECTION} osml-models:latest

In another terminal to invoke the rest server and return the inference on a single tile, run the following command from the root of this repository:

curl -I localhost:8080/ping
curl --request POST --data-binary "@<imagery file>" localhost:8080/invocations
  • Example: curl --request POST --data-binary "@assets/images/2_planes.tiff" localhost:8080/invocations

Executing above should return:

{"type": "FeatureCollection", "features": [{"geometry": {"coordinates": [0.0, 0.0], "type": "Point"}, "id": "7683a11e4c93f0332be9a4a53e0c6762", "properties": {"bounds_imcoords": [204.8, 204.8, 307.2, 307.2], "detection_score": 1.0, "feature_types": {"sample_object": 1.0}, "image_id": "8cdac8849cae2b4a8885c0dd0d34f722"}, "type": "Feature"}]}

Support & Feedback

OversightML Models are maintained by AWS Solution Architects. It is not part of an AWS service and support is provided best-effort by the OversightML community.

To post feedback, submit feature ideas, or report bugs, please use the Issues section of this GitHub repo.

If you are interested in contributing to OversightML Models, see the CONTRIBUTING guide.

Resources

Security

See CONTRIBUTING for more information.

License

MIT No Attribution Licensed. See LICENSE.