Keras模型服务器的Python客户端API
项目描述
keras-model-client
Python客户端API,用于Keras模型服务器。
从PyPI安装
pip install keras-model-client
基本用法
from keras_model_client import predict
# Using Detectron2 with the default model server
result = predict('/path/to/image.jpg', 'image_queue_detectron2')
# Using YOLOv5 with a custom model server
result = predict('/path/to/image.jpg', 'image_queue_yolov5', url='http://your-model-server/predictor/')
print(result)
# PredictionResult(success=True, predictions=[...])
注意: 默认模型服务器目前托管在 https://adamant.tator.io:8082/。
命令行界面
该软件包提供通过 model-server-predict
调用的命令行界面。例如
model-server-predict /path/to/image.jpg image_queue_detectron2 -f json
将运行位于 /path/to/image.jpg
的图像通过Detectron2模型,并将结果格式化为JSON。使用 -h
或 --help
标志可以获得更多帮助。
从源代码安装
克隆存储库
git clone https://github.com/kevinsbarnard/keras-model-client
cd keras-model-client
并使用Poetry
poetry install
或使用pip从源代码安装
pip install .
项目详情
下载文件
下载适合您平台的应用程序。如果您不确定选择哪一个,请了解更多关于 安装包 的信息。
源代码分布
keras-model-client-0.1.1.tar.gz (4.0 kB 查看哈希值)