Skip to main content

Base tools for telesto.ai models

Project description

telesto-base

Base Docker image and tools for telesto.ai models.

Instructions

telesto-base contains a pip-installable Python package and a Docker image, allowing you to easily package your models for telesto.ai competitions.

telesto-base package

To install the module, you can simply use pip:

pip install telesto-base

If you would like to use the latest not yet released version, you can install the one in the develop branch.

pip install git+https://github.com/telesto-ai/telesto-base.git@develop

The base image

The base image contains the pre-installed telesto-base module. Your submissions will use this as a base, so you'll only have to worry about the algorithms and not the packaging. To use it locally, you can pull the image from Docker Hub:

docker pull telestoai/model-api-base:latest

Alternatively, the image can also be built locally with the command

docker build -t telestoai/model-api-base -f Dockerfile .

An example model

If you are stuck on how to prepare your model for submission, we have prepared a concrete example for you. The example is available in the telesto-models repository with further instructions on the usage.

Test classification model API

Build and start a container

docker build -t telestoai/model-api-base -f Dockerfile .
docker run -p 9876:9876 --name model-api-base --rm --env USE_FALLBACK_MODEL=1 \
    telestoai/model-api-base classification

Send a sample input

curl -X POST -H "Content-Type:application/json" --data-binary @tests/data/class/example-input.json -i \
    http://localhost:9876/
...
{
    "predictions": [
        {"probs": {"cat": 0.32015, "dog": 0.67985}, "prediction": "dog"},
        {"probs": {"cat": 0.81545, "dog": 0.18455}, "prediction": "cat"}
    ]
}

Test segmentation model API

Build and start a container

docker build -t telestoai/model-api-base -f Dockerfile .
docker run -p 9876:9876 --name model-api-base --rm --env USE_FALLBACK_MODEL=1 \
    telestoai/model-api-base segmentation

Post a sample input

curl -X POST -H "Content-Type:application/json" --data-binary @tests/data/segm/example-input.json -i \
    http://localhost:9876/jobs
...
{
    "job_id": "b741bd19767441f6b7abd022744083c9"
}

Get the result

curl -H "Content-Type:application/json" -i http://localhost:9876/jobs/b741bd19767441f6b7abd022744083c9
...
{
    "mask": {
        "content": "<BASE_64_IMAGE>"
    }
}

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

telesto-base-0.0.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

telesto_base-0.0.4-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file telesto-base-0.0.4.tar.gz.

File metadata

  • Download URL: telesto-base-0.0.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for telesto-base-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6f988073586a81c4a21361d83600b30b55e4b7c82f75bb8cca8a550e743ad57a
MD5 97301370a239685307d69c05471d99c3
BLAKE2b-256 cc4330328000492927b25e90132e7d2e001bca7a6d192a8d87ac8df192ea0a75

See more details on using hashes here.

File details

Details for the file telesto_base-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: telesto_base-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1

File hashes

Hashes for telesto_base-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c7d43e32436f0caa31cd9e2a7fb73b02217d0e08829f2b36a859d747bfc16d13
MD5 1313d0a6c05ceb69290b11c12a193f60
BLAKE2b-256 6c8245e68447cbab41484c10a14fbd317640c18bce4cb97877cddde04ca021ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page