Model

Function Usage

Initializes a model.

Prototype

Prototype 1:
1
Model(modelPath: str, deviceId: int = 0)
Prototype 2:
Model(option: ModelLoadOptV2, deviceId: int)

Input Parameters

Prototype 1:

Parameter

Type

Description

modelPath

str

Model path

deviceId

int

Device where the model is deployed. The default value is 0. (The value -1 indicates that the model is deployed on the host. In this case, this field is reserved and cannot be used.)

Prototype 2:

Parameter

Type

Description

option

ModelLoadOptV2 data type

You can select a model input mode through parameter settings. For details, see ModelLoadOptV2.

deviceId

int

Device where the model is deployed. The default value is 0. (The value -1 indicates that the model is deployed on the host. In this case, this field is reserved and cannot be used.)

Response Parameters

Model object