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.1.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for tf_serving-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f405d91868f8f195a109364f0d448acc52c0ae7b75c8615118c39e783ecd2e1c |
|
MD5 | 0d312c3736bf094f1305afae0310a0e0 |
|
BLAKE2b-256 | 3c344d2c9e3c1f5167976ece909890660deb3784d06dc3f380eda07a2b39f2fd |