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.3.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for tf_serving-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc2ac3c4ac4315417eedf52f4c48fb1f85e881eb60f5a6b7396d8e0cf1bca4ce |
|
MD5 | 3159b16d51cf2cb8bc3effdf2c73e24c |
|
BLAKE2b-256 | 413e5b3d569f454cc767612f7ae83b249eb9e690e2462bb69ac473b00777154d |