viam.proto.service.mlmodel

@generated by Viam. Do not edit manually!

Package Contents

Classes

MLModelServiceBase

Helper class that provides a standard way to create an ABC using

MLModelServiceStub

File

Abstract base class for protocol messages.

FlatTensor

Abstract base class for protocol messages.

FlatTensorDataDouble

Abstract base class for protocol messages.

FlatTensorDataFloat

Abstract base class for protocol messages.

FlatTensorDataInt8

Abstract base class for protocol messages.

FlatTensorDataInt16

Abstract base class for protocol messages.

FlatTensorDataInt32

Abstract base class for protocol messages.

FlatTensorDataInt64

Abstract base class for protocol messages.

FlatTensorDataUInt8

Abstract base class for protocol messages.

FlatTensorDataUInt16

Abstract base class for protocol messages.

FlatTensorDataUInt32

Abstract base class for protocol messages.

FlatTensorDataUInt64

Abstract base class for protocol messages.

FlatTensors

Abstract base class for protocol messages.

InferRequest

Abstract base class for protocol messages.

InferResponse

Abstract base class for protocol messages.

LabelType

Metadata

Abstract base class for protocol messages.

MetadataRequest

Abstract base class for protocol messages.

MetadataResponse

Abstract base class for protocol messages.

TensorInfo

Abstract base class for protocol messages.

class viam.proto.service.mlmodel.MLModelServiceBase[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract async Infer(stream: grpclib.server.Stream[service.mlmodel.v1.mlmodel_pb2.InferRequest, service.mlmodel.v1.mlmodel_pb2.InferResponse]) None[source]
abstract async Metadata(stream: grpclib.server.Stream[service.mlmodel.v1.mlmodel_pb2.MetadataRequest, service.mlmodel.v1.mlmodel_pb2.MetadataResponse]) None[source]
__mapping__() Dict[str, grpclib.const.Handler][source]
class viam.proto.service.mlmodel.MLModelServiceStub(channel: grpclib.client.Channel)[source]
class viam.proto.service.mlmodel.File(*, name: str = ..., description: str = ..., label_type: global___LabelType = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

name: str

name of the file, with file extension

description: str

description of what the file contains

label_type: global___LabelType

How to associate the arrays/tensors to the labels in the file

class viam.proto.service.mlmodel.FlatTensor(*, shape: collections.abc.Iterable[int] | None = ..., int8_tensor: global___FlatTensorDataInt8 | None = ..., uint8_tensor: global___FlatTensorDataUInt8 | None = ..., int16_tensor: global___FlatTensorDataInt16 | None = ..., uint16_tensor: global___FlatTensorDataUInt16 | None = ..., int32_tensor: global___FlatTensorDataInt32 | None = ..., uint32_tensor: global___FlatTensorDataUInt32 | None = ..., int64_tensor: global___FlatTensorDataInt64 | None = ..., uint64_tensor: global___FlatTensorDataUInt64 | None = ..., float_tensor: global___FlatTensorDataFloat | None = ..., double_tensor: global___FlatTensorDataDouble | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property shape: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

the shape of the provided tensor as a list of integer extents

property int8_tensor: global___FlatTensorDataInt8
property uint8_tensor: global___FlatTensorDataUInt8
property int16_tensor: global___FlatTensorDataInt16
property uint16_tensor: global___FlatTensorDataUInt16
property int32_tensor: global___FlatTensorDataInt32
property uint32_tensor: global___FlatTensorDataUInt32
property int64_tensor: global___FlatTensorDataInt64
property uint64_tensor: global___FlatTensorDataUInt64
property float_tensor: global___FlatTensorDataFloat
property double_tensor: global___FlatTensorDataDouble
HasField(field_name: Literal[double_tensor, b'double_tensor', float_tensor, b'float_tensor', int16_tensor, b'int16_tensor', int32_tensor, b'int32_tensor', int64_tensor, b'int64_tensor', int8_tensor, b'int8_tensor', tensor, b'tensor', uint16_tensor, b'uint16_tensor', uint32_tensor, b'uint32_tensor', uint64_tensor, b'uint64_tensor', uint8_tensor, b'uint8_tensor']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.

WhichOneof(oneof_group: Literal[tensor, b'tensor']) Literal[int8_tensor, uint8_tensor, int16_tensor, uint16_tensor, int32_tensor, uint32_tensor, int64_tensor, uint64_tensor, float_tensor, double_tensor] | None

Returns the name of the field that is set inside a oneof group.

If no field is set, returns None.

Parameters:

oneof_group (str) – the name of the oneof group to check.

Returns:

The name of the group that is set, or None.

Return type:

str or None

Raises:

ValueError – no group with the given name exists

class viam.proto.service.mlmodel.FlatTensorDataDouble(*, data: collections.abc.Iterable[float] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[float]
class viam.proto.service.mlmodel.FlatTensorDataFloat(*, data: collections.abc.Iterable[float] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[float]
class viam.proto.service.mlmodel.FlatTensorDataInt8(*, data: bytes = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

data: bytes
class viam.proto.service.mlmodel.FlatTensorDataInt16(*, data: collections.abc.Iterable[int] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

packs two 16-bit numbers per entry - explicitly little-endian so big-endian producers/consumers must compensate

class viam.proto.service.mlmodel.FlatTensorDataInt32(*, data: collections.abc.Iterable[int] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]
class viam.proto.service.mlmodel.FlatTensorDataInt64(*, data: collections.abc.Iterable[int] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]
class viam.proto.service.mlmodel.FlatTensorDataUInt8(*, data: bytes = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

data: bytes
class viam.proto.service.mlmodel.FlatTensorDataUInt16(*, data: collections.abc.Iterable[int] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

packs two 16-bit numbers per entry - explicitly little-endian so big-endian producers/consumers must compensate

class viam.proto.service.mlmodel.FlatTensorDataUInt32(*, data: collections.abc.Iterable[int] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]
class viam.proto.service.mlmodel.FlatTensorDataUInt64(*, data: collections.abc.Iterable[int] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property data: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]
class viam.proto.service.mlmodel.FlatTensors(*, tensors: collections.abc.Mapping[str, global___FlatTensor] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

class TensorsEntry(*, key: str = ..., value: global___FlatTensor | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property value: global___FlatTensor
key: str
HasField(field_name: Literal[value, b'value']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.

property tensors: google.protobuf.internal.containers.MessageMap[str, global___FlatTensor]

A name-indexed collection of flat tensor objects

class viam.proto.service.mlmodel.InferRequest(*, name: str = ..., input_tensors: global___FlatTensors | None = ..., extra: google.protobuf.struct_pb2.Struct | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property input_tensors: global___FlatTensors

the input data is provided as set of named flat tensors

property extra: google.protobuf.struct_pb2.Struct

Additional arguments to the method

name: str

name of the model service

HasField(field_name: Literal[extra, b'extra', input_tensors, b'input_tensors']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.

class viam.proto.service.mlmodel.InferResponse(*, output_tensors: global___FlatTensors | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property output_tensors: global___FlatTensors

the output data is provided as a set of named flat tensors

HasField(field_name: Literal[output_tensors, b'output_tensors']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.

class viam.proto.service.mlmodel.LabelType

Bases: _LabelType

class viam.proto.service.mlmodel.Metadata(*, name: str = ..., type: str = ..., description: str = ..., input_info: collections.abc.Iterable[global___TensorInfo] | None = ..., output_info: collections.abc.Iterable[global___TensorInfo] | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property input_info: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TensorInfo]

the necessary input arrays/tensors for an inference, order matters

property output_info: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TensorInfo]

the output arrays/tensors of the model, order matters

name: str

name of the model

type: str

type of model e.g. object_detector, text_classifier

description: str

description of the model

class viam.proto.service.mlmodel.MetadataRequest(*, name: str = ..., extra: google.protobuf.struct_pb2.Struct | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property extra: google.protobuf.struct_pb2.Struct

Additional arguments to the method

name: str

name of the model service

HasField(field_name: Literal[extra, b'extra']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.

class viam.proto.service.mlmodel.MetadataResponse(*, metadata: global___Metadata | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property metadata: global___Metadata

this is the metadata associated with the ML model

HasField(field_name: Literal[metadata, b'metadata']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.

class viam.proto.service.mlmodel.TensorInfo(*, name: str = ..., description: str = ..., data_type: str = ..., shape: collections.abc.Iterable[int] | None = ..., associated_files: collections.abc.Iterable[global___File] | None = ..., extra: google.protobuf.struct_pb2.Struct | None = ...)

Bases: google.protobuf.message.Message

Abstract base class for protocol messages.

Protocol message classes are almost always generated by the protocol compiler. These generated types subclass Message and implement the methods shown below.

property shape: google.protobuf.internal.containers.RepeatedScalarFieldContainer[int]

shape of the array/tensor (-1 for unknown)

property associated_files: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___File]

files associated with the array/tensor, like for category labels

property extra: google.protobuf.struct_pb2.Struct

anything else you want to say

name: str

name of the data in the array/tensor

description: str

description of the data in the array/tensor

data_type: str

data type of the array/tensor, e.g. float32, float64, uint8

HasField(field_name: Literal[extra, b'extra']) bool

Checks if a certain field is set for the message.

For a oneof group, checks if any field inside is set. Note that if the field_name is not defined in the message descriptor, ValueError will be raised.

Parameters:

field_name (str) – The name of the field to check for presence.

Returns:

Whether a value has been set for the named field.

Return type:

bool

Raises:

ValueError – if the field_name is not a member of this message.