PySDK 0.10.1
Release Date: 11/2/2023
New Features and Modifications
-
The HTTP+WebSocket AI server protocol is initially supported for DeGirum AI Server.
Starting from PySDK version 0.10.0, AI server supports two protocols:
asio
andhttp
. Theasio
protocol is DeGirum custom socket-based AI server protocol, supported by all previous PySDK versions. Thehttp
protocol is a new protocol, which is based on REST HTTP requests and WebSockets streaming. Thehttp
protocol allows to use AI server from any programming language, which supports HTTP requests and WebSockets, such as browser-based JavaScript, which does not support native sockets, thus precluding the use ofasio
protocol.When you start AI server by executing
degirum server start
command, you specify the protocol using--protocol
parameter, which can beasio
,http
, orboth
.If you omit this parameter,
asio
protocol will be used by default to provide compatible behavior with previous PySDK verisions.You select the
http
protocol by specifying--protocol http
.You may select both protocols by specifying
--protocol both
. In this case, AI server will listen to both protocols on two consecutive TCP ports: the first port is used forasio
protocol, the second port is used forhttp
protocol.For example: start AI server to serve models from
./my-zoo
directory, useasio
protocol on port 12345, and usehttp
protocol on port 12346:On a client side, when you connect to AI server with
http
protocol, you have to prefix AI server hostname withhttp://
prefix, for example:To connect to AI server with
asio
protocol you simply omit the protocol prefix. -
Now you may pass arbitrary model properties (properties of
degirum.model.Model`` class) as keyword arguments to
degirum.zoo_manager.ZooManager.load_model` method. In this case these properties will be assigned to the model object.For example:
-
Multi-classifier (or multi-label) classification models are initially supported. The post-processor type string, which is assigned to
OutputPostprocessType
model parameter, is"MultiLabelClassification"
. Each inference result dictionary contains the following keys:classifier
: object class string.results
: list of class labels and its scores. Scores are optional.
The
results
list element is a dictionary with the following keys:label
: class label string.score
: optional class label probability.
Example:
Bug Fixes
-
Unclear error message
'NoneType' object has no attribute 'shape'
appears when supplying non-existing file for model inference. -
Local AI inference of a model with Python post-processor hangs on model destruction due to Python GIL deadlock.
-
degirum sys-info
command re-initializes DeGirum Orca AI accelerator hardware not in interprocess-safe way, disrupting operation of other processes using the same Orca accelerator hardware. The first attempt to fix this bug was in PySDK version 0.9.6, this release finally fixes this bug.