Metadata-Version: 2.1
Name: osml-models
Version: 1.2.0
Summary: A set of demonstration models to test OSML with.
Author: Amazon Web Services
Author-email: todo-public-library-poc@amazon.com
License: 
        MIT No Attribution
        
        Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
        the Software, and to permit persons to whom the Software is furnished to do so.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
        FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
        COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
        IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
        CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project-URL: Source, https://github.com/aws-solutions-library-samples/osml-models
Project-URL: Tracker, https://github.com/aws-solutions-library-samples/osml-models/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: json-logging==1.3.0
Requires-Dist: boto3==1.34.104
Requires-Dist: setuptools==68.0.0
Requires-Dist: argparse==1.4.0
Requires-Dist: flask==2.3.3
Requires-Dist: waitress==2.1.2
Requires-Dist: shapely==2.0.1
Requires-Dist: matplotlib==3.7.2
Provides-Extra: gdal
Requires-Dist: gdal>=3.7.0; extra == "gdal"
Provides-Extra: test
Requires-Dist: tox; extra == "test"

# 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](#getting-started)
    * [Prerequisites](#prerequisites)
    * [Installation Guide](#installation-guide)
    * [Documentation](#documentation)
    * [Build and Local Testing](#build-and-local-testing)
* [Support & Feedback](#support--feedback)
* [Resources](#resources)
* [Security](#security)
* [License](#license)


## Getting Started
### Prerequisites:

First, ensure you have installed the following tools locally

- [docker](https://nodejs.org/en)

### Installation Guide

Clone `osml-models` package into your desktop

```sh
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.

```shell
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.
```bash
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:
```bash
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:

```bash
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](https://github.com/aws-solutions-library-samples/osml-models/issues) section of this GitHub repo.

If you are interested in contributing to OversightML Models, see the [CONTRIBUTING](CONTRIBUTING.md) guide.

## Resources

- [Aircraft Models](https://www.cosmiqworks.org/rareplanes/)

## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.

## License

MIT No Attribution Licensed. See [LICENSE](LICENSE).
