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.4.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for tf_serving-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b750fdace186cb58e3f356f49893957a3830aaa612e6a202ac9a17623fbb4bd |
|
MD5 | f283f7029a2936c9ff28609b549d59d4 |
|
BLAKE2b-256 | 4c94078d36ce793956acd57d8a67632ac46569ceec98ed567bdd25c4f099fad1 |