Skip to main content

Client for OCR predictions against TensorFlow Serving

Project description

TensorFlow Serving Client

Client for OCR predictions against TensorFlow Serving

pip install tf-serving

Model

The served model must return the following schema:

{
  preds: StringTensor[BATCH x TOP_PATHS],
  logprobs: FloatTensor[BATCH x TOP_PATHS]
}

Usage

from tf.serving import predict, encode64

with open('path/to/image.jpg', 'rb') as f:
  img = encode64(f.read())

await predict([img], host='http://localhost', port=8501, endpoint='/v1/models/ocr:predict')
# Right(value=[ImagePreds(preds=['Place', 'Piace', ...], logprobs=[-0.187645972, -2.03857613, ...])], tag='right')

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

tf_serving-0.1.5.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

tf_serving-0.1.5-py3-none-any.whl (4.4 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