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)
Built Distribution
Close
Hashes for tf_serving-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bedbb4c5019aca3bf35a660d158d0b5a4fdb8c45b0b4b38b951ac4d55bbd72e8 |
|
MD5 | 5e400c66b3d6db99d4830ea54a638114 |
|
BLAKE2b-256 | c524b098604d51272a14549185ce9016205672f99aa11fc2ccc932adc8758e18 |