Interface Model#
interface Model {
clone(): Model;
inputs: Output[];
outputs: Output[];
getFriendlyName(): string;
getName(): string;
getOutputShape(index): number[];
getOutputSize(): number;
getOutputElementType(index): string;
input(): Output;
input(name): Output;
input(index): Output;
isDynamic(): boolean;
output(): Output;
output(name): Output;
output(index): Output;
setFriendlyName(name): void;
}
A user-defined model read by Core.readModel.
Defined in: addon.ts:230
Properties#
inputs
inputs: Output[]
Defined in: addon.ts:305
outputs
outputs: Output[]
Defined in: addon.ts:309
Methods#
clone
clone(): Model;
It returns a cloned model.
Returns: Model
Defined in: addon.ts:234
getFriendlyName name: getFriendlyName
getFriendlyName(): string
It gets the friendly name for a model. If a friendly name is not set via Model.setFriendlyName, a unique model name is returned.
Returns: string
A string with a friendly name of the model.
Defined in: addon.ts:240
getName
getName(): string
It gets the unique name of the model.
Returns: string
A string with the name of the model.
Defined in: addon.ts:245
getOutputShape
getOutputShape(): number[]
It returns the shape of the element at the specified index.
Returns: number[]
Defined in: addon.ts:250
getOutputSize
getOutputSize(): number[]
It returns the number of the model outputs.
Returns: number[]
Defined in: addon.ts:254
getOutputElementType
getOutputElementType(index): string;
It gets the element type of a specific output of the model.
Parameters:
index: number
The index of the output.
Returns: string
Defined in: addon.ts:259
input
input(): Output
It gets the input of the model. If a model has more than one input, this method throws an exception.
Returns: Output
Defined in: addon.ts:264
input(name: string): Output
It gets the input of the model identified by the tensor name.
Parameters:
Optional
name: string
The tensor name.
Returns: Output
Defined in: addon.ts:269
input(index: number): Output
It gets the input of the model identified by the index.
Parameters:
Optional
index: number
The index of the input.
Returns: Output
Defined in: addon.ts:274
isDynamic
isDynamic(): boolean
It returns true if any of the ops defined in the model contains a partial shape.
Returns: boolean
Defined in: addon.ts:279
output
output(): Output
It gets the output of the model. If a model has more than one output, this method throws an exception.
Returns: Output
Defined in: addon.ts:284
output
output(name): Output
It gets the output of the model identified by the tensor name.
Parameters:
Optional
name: string
Returns: Output
Defined in: addon.ts:289
output(index): Output
It gets the output of the model identified by the index.
Parameters:
Optional
index: number
Returns: Output
Defined in: addon.ts:294
setFriendlyName
setFriendlyName(name): void
Sets a friendly name for the model. This does not overwrite the unique model name and is retrieved via Model.getFriendlyName. Mainly used for debugging.
Parameters:
name: string
Returns: void
Defined in: addon.ts:301