Skip to main content

Python client API for the Keras Model Server

Project description

keras-model-client

Python client API for the Keras Model Server.

Install from PyPI:

pip install keras-model-client

Basic usage:

from keras_model_client import predict

# Using Detectron2 with the default model server
result = predict('/path/to/image.jpg', 'image_queue_detectron2')

# Using YOLOv5 with a custom model server
result = predict('/path/to/image.jpg', 'image_queue_yolov5', url='http://your-model-server/predictor/')

print(result)
# PredictionResult(success=True, predictions=[...])

Note: The default model server is currently hosted at https://adamant.tator.io:8082/.

CLI

The package provides a command-line interface invoked with model-server-predict. For example:

model-server-predict /path/to/image.jpg image_queue_detectron2 -f json

will run the image at /path/to/image.jpg through the Detectron2 model and format the results as JSON. Additional help is available with the -h or --help flag.

Install from source

Clone the repository:

git clone https://github.com/kevinsbarnard/keras-model-client
cd keras-model-client

and install from source with Poetry:

poetry install

or with pip:

pip install .

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

keras-model-client-0.1.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

keras_model_client-0.1.1-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

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