kinfer 0.0.4__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. kinfer-0.0.6/PKG-INFO +51 -0
  2. kinfer-0.0.6/README.md +30 -0
  3. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer/__init__.py +1 -1
  4. kinfer-0.0.6/kinfer/export/pytorch.py +126 -0
  5. kinfer-0.0.6/kinfer/inference/python.py +72 -0
  6. kinfer-0.0.6/kinfer/proto/__init__.py +40 -0
  7. kinfer-0.0.6/kinfer/proto/kinfer_pb2.py +106 -0
  8. kinfer-0.0.6/kinfer/proto/kinfer_pb2.pyi +861 -0
  9. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer/requirements-dev.txt +1 -0
  10. kinfer-0.0.6/kinfer/requirements.txt +9 -0
  11. kinfer-0.0.6/kinfer/serialize/__init__.py +36 -0
  12. kinfer-0.0.6/kinfer/serialize/base.py +528 -0
  13. kinfer-0.0.6/kinfer/serialize/json.py +355 -0
  14. kinfer-0.0.6/kinfer/serialize/numpy.py +373 -0
  15. kinfer-0.0.6/kinfer/serialize/pytorch.py +378 -0
  16. kinfer-0.0.6/kinfer/serialize/schema.py +125 -0
  17. kinfer-0.0.6/kinfer/serialize/types.py +17 -0
  18. kinfer-0.0.6/kinfer/serialize/utils.py +177 -0
  19. kinfer-0.0.6/kinfer.egg-info/PKG-INFO +51 -0
  20. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer.egg-info/SOURCES.txt +11 -1
  21. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer.egg-info/requires.txt +2 -0
  22. {kinfer-0.0.4 → kinfer-0.0.6}/pyproject.toml +14 -6
  23. {kinfer-0.0.4 → kinfer-0.0.6}/setup.py +2 -7
  24. kinfer-0.0.6/tests/test_infer.py +101 -0
  25. kinfer-0.0.4/PKG-INFO +0 -22
  26. kinfer-0.0.4/README.md +0 -3
  27. kinfer-0.0.4/kinfer/export/pytorch.py +0 -224
  28. kinfer-0.0.4/kinfer/inference/python.py +0 -106
  29. kinfer-0.0.4/kinfer/requirements.txt +0 -5
  30. kinfer-0.0.4/kinfer.egg-info/PKG-INFO +0 -22
  31. kinfer-0.0.4/tests/test_dummy.py +0 -12
  32. kinfer-0.0.4/tests/test_infer.py +0 -193
  33. {kinfer-0.0.4 → kinfer-0.0.6}/LICENSE +0 -0
  34. {kinfer-0.0.4 → kinfer-0.0.6}/MANIFEST.in +0 -0
  35. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer/export/__init__.py +0 -0
  36. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer/inference/__init__.py +0 -0
  37. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer/py.typed +0 -0
  38. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer.egg-info/dependency_links.txt +0 -0
  39. {kinfer-0.0.4 → kinfer-0.0.6}/kinfer.egg-info/top_level.txt +0 -0
  40. {kinfer-0.0.4 → kinfer-0.0.6}/setup.cfg +0 -0
kinfer-0.0.6/PKG-INFO ADDED
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.1
2
+ Name: kinfer
3
+ Version: 0.0.6
4
+ Summary: Tool to make it easier to run a model on a real robot
5
+ Home-page: https://github.com/kscalelabs/kinfer.git
6
+ Author: K-Scale Labs
7
+ Requires-Python: >=3.11
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: torch
11
+ Requires-Dist: onnx
12
+ Requires-Dist: onnxruntime
13
+ Requires-Dist: protobuf
14
+ Provides-Extra: dev
15
+ Requires-Dist: black; extra == "dev"
16
+ Requires-Dist: darglint; extra == "dev"
17
+ Requires-Dist: mypy; extra == "dev"
18
+ Requires-Dist: mypy-protobuf; extra == "dev"
19
+ Requires-Dist: pytest; extra == "dev"
20
+ Requires-Dist: ruff; extra == "dev"
21
+
22
+ # kinfer
23
+
24
+ This package is designed to support exporting and running inference on PyTorch models.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install kinfer
30
+ ```
31
+
32
+ ### ONNX Runtime
33
+
34
+ You can install the latest version of ONNX Runtime on Mac with:
35
+
36
+ ```bash
37
+ brew install onnxruntime
38
+ ```
39
+
40
+ You may need to add the binary to your DYLD_LIBRARY_PATH:
41
+
42
+ ```bash
43
+ $ brew ls onnxruntime
44
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/include/onnxruntime/ (11 files)
45
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/libonnxruntime.1.20.1.dylib # <-- This is the binary
46
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/cmake/ (4 files)
47
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/pkgconfig/libonnxruntime.pc
48
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/libonnxruntime.dylib
49
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/sbom.spdx.json
50
+ $ export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/onnxruntime/1.20.1/lib:$DYLD_LIBRARY_PATH
51
+ ```
kinfer-0.0.6/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # kinfer
2
+
3
+ This package is designed to support exporting and running inference on PyTorch models.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install kinfer
9
+ ```
10
+
11
+ ### ONNX Runtime
12
+
13
+ You can install the latest version of ONNX Runtime on Mac with:
14
+
15
+ ```bash
16
+ brew install onnxruntime
17
+ ```
18
+
19
+ You may need to add the binary to your DYLD_LIBRARY_PATH:
20
+
21
+ ```bash
22
+ $ brew ls onnxruntime
23
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/include/onnxruntime/ (11 files)
24
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/libonnxruntime.1.20.1.dylib # <-- This is the binary
25
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/cmake/ (4 files)
26
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/pkgconfig/libonnxruntime.pc
27
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/lib/libonnxruntime.dylib
28
+ /opt/homebrew/Cellar/onnxruntime/1.20.1/sbom.spdx.json
29
+ $ export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/onnxruntime/1.20.1/lib:$DYLD_LIBRARY_PATH
30
+ ```
@@ -1,3 +1,3 @@
1
- __version__ = "0.0.4"
1
+ __version__ = "0.0.6"
2
2
 
3
3
  from . import export, inference
@@ -0,0 +1,126 @@
1
+ """PyTorch model export utilities."""
2
+
3
+ import inspect
4
+ from io import BytesIO
5
+ from typing import Sequence
6
+
7
+ import onnx
8
+ import onnxruntime as ort
9
+ import torch
10
+ from torch import Tensor
11
+
12
+ from kinfer import proto as P
13
+ from kinfer.serialize.pytorch import PyTorchMultiSerializer
14
+ from kinfer.serialize.schema import get_dummy_io
15
+ from kinfer.serialize.utils import check_names_match
16
+
17
+ KINFER_METADATA_KEY = "kinfer_metadata"
18
+
19
+
20
+ def _add_metadata_to_onnx(model_proto: onnx.ModelProto, schema: P.ModelSchema) -> onnx.ModelProto:
21
+ """Add metadata to ONNX model.
22
+
23
+ Args:
24
+ model_proto: ONNX model prototype
25
+ schema: Model schema to use for model export.
26
+
27
+ Returns:
28
+ ONNX model with added metadata
29
+ """
30
+ schema_bytes = schema.SerializeToString()
31
+ meta = model_proto.metadata_props.add()
32
+ meta.key = KINFER_METADATA_KEY
33
+ meta.value = schema_bytes
34
+ return model_proto
35
+
36
+
37
+ def export_model(
38
+ model: torch.jit.ScriptModule,
39
+ schema: P.ModelSchema,
40
+ ) -> onnx.ModelProto:
41
+ """Export PyTorch model to ONNX format with metadata.
42
+
43
+ Args:
44
+ model: PyTorch model to export.
45
+ schema: Model schema to use for model export.
46
+
47
+ Returns:
48
+ ONNX inference session
49
+ """
50
+ # Matches each input name to the input values.
51
+ signature = inspect.signature(model.forward)
52
+ model_input_names = [
53
+ p.name for p in signature.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD
54
+ ]
55
+ if len(model_input_names) != len(schema.input_schema.values):
56
+ raise ValueError(f"Expected {len(model_input_names)} inputs, but schema has {len(schema.input_schema.values)}")
57
+ input_schema_names = [i.value_name for i in schema.input_schema.values]
58
+ output_schema_names = [o.value_name for o in schema.output_schema.values]
59
+ if model_input_names != input_schema_names:
60
+ raise ValueError(f"Expected input names {model_input_names} to match schema names {input_schema_names}")
61
+
62
+ input_serializer = PyTorchMultiSerializer(schema.input_schema)
63
+ output_serializer = PyTorchMultiSerializer(schema.output_schema)
64
+
65
+ input_dummy_values = get_dummy_io(schema.input_schema)
66
+ input_tensors = input_serializer.serialize_io(input_dummy_values, as_dict=True)
67
+
68
+ check_names_match("model_input_names", model_input_names, "input_schema", list(input_tensors.keys()))
69
+ input_tensor_list = [input_tensors[name] for name in model_input_names]
70
+
71
+ # Attempts to run the model with the dummy inputs.
72
+ try:
73
+ pred_output_tensors = model(*input_tensor_list)
74
+ except Exception as e:
75
+ signature = inspect.signature(model.forward)
76
+ model_input_names = [
77
+ p.name for p in signature.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD
78
+ ]
79
+ raise ValueError(
80
+ f"Failed to run model with dummy inputs; input names are {model_input_names} while "
81
+ f"input schema is {schema.input_schema}"
82
+ ) from e
83
+
84
+ # Attempts to parse the output tensors using the output schema.
85
+ if isinstance(pred_output_tensors, Tensor):
86
+ pred_output_tensors = (pred_output_tensors,)
87
+ if isinstance(pred_output_tensors, Sequence):
88
+ pred_output_tensors = output_serializer.assign_names(pred_output_tensors)
89
+ if not isinstance(pred_output_tensors, dict):
90
+ raise ValueError("Output tensors could not be converted to dictionary")
91
+ try:
92
+ pred_output_tensors = output_serializer.deserialize_io(pred_output_tensors)
93
+ except Exception as e:
94
+ raise ValueError("Failed to parse output tensors using output schema; are you sure it is correct?") from e
95
+
96
+ # Export model to buffer
97
+ buffer = BytesIO()
98
+ torch.onnx.export(
99
+ model=model,
100
+ f=buffer, # type: ignore[arg-type]
101
+ kwargs=input_tensors,
102
+ input_names=input_schema_names,
103
+ output_names=output_schema_names,
104
+ )
105
+ buffer.seek(0)
106
+
107
+ # Loads the model from the buffer and adds metadata.
108
+ model_proto = onnx.load_model(buffer)
109
+ model_proto = _add_metadata_to_onnx(model_proto, schema)
110
+
111
+ return model_proto
112
+
113
+
114
+ def get_model(model_proto: onnx.ModelProto) -> ort.InferenceSession:
115
+ """Converts a model proto to an inference session.
116
+
117
+ Args:
118
+ model_proto: ONNX model proto to convert to inference session.
119
+
120
+ Returns:
121
+ ONNX inference session
122
+ """
123
+ buffer = BytesIO()
124
+ onnx.save_model(model_proto, buffer)
125
+ buffer.seek(0)
126
+ return ort.InferenceSession(buffer.read())
@@ -0,0 +1,72 @@
1
+ """ONNX model inference utilities for Python."""
2
+
3
+ from pathlib import Path
4
+
5
+ import onnx
6
+ import onnxruntime as ort
7
+
8
+ from kinfer import proto as P
9
+ from kinfer.export.pytorch import KINFER_METADATA_KEY
10
+ from kinfer.serialize.numpy import NumpyMultiSerializer
11
+
12
+
13
+ class ONNXModel:
14
+ """Wrapper for ONNX model inference."""
15
+
16
+ def __init__(self, model_path: str | Path) -> None:
17
+ """Initialize ONNX model.
18
+
19
+ Args:
20
+ model_path: Path to ONNX model file
21
+ config: Optional inference configuration
22
+ """
23
+ self.model_path = model_path
24
+
25
+ # Load model and create inference session
26
+ self.model = onnx.load(model_path)
27
+ self.session = ort.InferenceSession(model_path)
28
+ self.attached_metadata: dict[str, str] = {}
29
+
30
+ # Extract metadata and attempt to parse JSON values
31
+ for prop in self.model.metadata_props:
32
+ if prop.key == KINFER_METADATA_KEY:
33
+ try:
34
+ schema = P.ModelSchema.FromString(prop.value.encode("utf-8"))
35
+ except Exception as e:
36
+ raise ValueError("Failed to parse kinfer_metadata value") from e
37
+ break
38
+ else:
39
+ self.attached_metadata[prop.key] = prop.value
40
+ else:
41
+ raise ValueError("kinfer_metadata not found in model metadata")
42
+
43
+ # Extract input and output schemas from metadata
44
+ self._schema = schema
45
+
46
+ # Create serializers for input and output.
47
+ self._input_serializer = NumpyMultiSerializer(self._schema.input_schema)
48
+ self._output_serializer = NumpyMultiSerializer(self._schema.output_schema)
49
+
50
+ def __call__(self, inputs: P.IO) -> P.IO:
51
+ """Run inference on input data.
52
+
53
+ Args:
54
+ inputs: Input data, matching the input schema.
55
+
56
+ Returns:
57
+ Model outputs, matching the output schema.
58
+ """
59
+ inputs_np = self._input_serializer.serialize_io(inputs, as_dict=True)
60
+ outputs_np = self.session.run(None, inputs_np)
61
+ outputs = self._output_serializer.deserialize_io(outputs_np)
62
+ return outputs
63
+
64
+ @property
65
+ def input_schema(self) -> P.IOSchema:
66
+ """Get the input schema."""
67
+ return self._schema.input_schema
68
+
69
+ @property
70
+ def output_schema(self) -> P.IOSchema:
71
+ """Get the output schema."""
72
+ return self._schema.output_schema
@@ -0,0 +1,40 @@
1
+ """Defines helper types for the protocol buffers."""
2
+
3
+ from .kinfer_pb2 import (
4
+ AudioFrameSchema,
5
+ AudioFrameValue,
6
+ CameraFrameSchema,
7
+ CameraFrameValue,
8
+ DType,
9
+ ImuAccelerometerValue,
10
+ ImuGyroscopeValue,
11
+ ImuMagnetometerValue,
12
+ ImuSchema,
13
+ ImuValue,
14
+ IOSchema,
15
+ IO,
16
+ JointCommandsSchema,
17
+ JointCommandsValue,
18
+ JointCommandValue,
19
+ JointPositionsSchema,
20
+ JointPositionsValue,
21
+ JointPositionUnit,
22
+ JointPositionValue,
23
+ JointTorquesSchema,
24
+ JointTorquesValue,
25
+ JointTorqueUnit,
26
+ JointTorqueValue,
27
+ JointVelocitiesSchema,
28
+ JointVelocitiesValue,
29
+ JointVelocityUnit,
30
+ JointVelocityValue,
31
+ ModelSchema,
32
+ StateTensorSchema,
33
+ StateTensorValue,
34
+ TimestampSchema,
35
+ TimestampValue,
36
+ Value,
37
+ ValueSchema,
38
+ VectorCommandSchema,
39
+ VectorCommandValue,
40
+ )
@@ -0,0 +1,106 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: kinfer.proto
5
+ # Protobuf Python Version: 5.28.3
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 28,
16
+ 3,
17
+ '',
18
+ 'kinfer.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0ckinfer.proto\x12\x0ckinfer.proto\"f\n\x12JointPositionValue\x12\x12\n\njoint_name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02\x12-\n\x04unit\x18\x03 \x01(\x0e\x32\x1f.kinfer.proto.JointPositionUnit\"Z\n\x14JointPositionsSchema\x12-\n\x04unit\x18\x01 \x01(\x0e\x32\x1f.kinfer.proto.JointPositionUnit\x12\x13\n\x0bjoint_names\x18\x02 \x03(\t\"G\n\x13JointPositionsValue\x12\x30\n\x06values\x18\x01 \x03(\x0b\x32 .kinfer.proto.JointPositionValue\"f\n\x12JointVelocityValue\x12\x12\n\njoint_name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02\x12-\n\x04unit\x18\x03 \x01(\x0e\x32\x1f.kinfer.proto.JointVelocityUnit\"[\n\x15JointVelocitiesSchema\x12-\n\x04unit\x18\x01 \x01(\x0e\x32\x1f.kinfer.proto.JointVelocityUnit\x12\x13\n\x0bjoint_names\x18\x02 \x03(\t\"H\n\x14JointVelocitiesValue\x12\x30\n\x06values\x18\x01 \x03(\x0b\x32 .kinfer.proto.JointVelocityValue\"b\n\x10JointTorqueValue\x12\x12\n\njoint_name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02\x12+\n\x04unit\x18\x03 \x01(\x0e\x32\x1d.kinfer.proto.JointTorqueUnit\"V\n\x12JointTorquesSchema\x12+\n\x04unit\x18\x01 \x01(\x0e\x32\x1d.kinfer.proto.JointTorqueUnit\x12\x13\n\x0bjoint_names\x18\x02 \x03(\t\"C\n\x11JointTorquesValue\x12.\n\x06values\x18\x01 \x03(\x0b\x32\x1e.kinfer.proto.JointTorqueValue\"\xce\x01\n\x13JointCommandsSchema\x12\x13\n\x0bjoint_names\x18\x01 \x03(\t\x12\x32\n\x0btorque_unit\x18\x02 \x01(\x0e\x32\x1d.kinfer.proto.JointTorqueUnit\x12\x36\n\rvelocity_unit\x18\x03 \x01(\x0e\x32\x1f.kinfer.proto.JointVelocityUnit\x12\x36\n\rposition_unit\x18\x04 \x01(\x0e\x32\x1f.kinfer.proto.JointPositionUnit\"\x97\x02\n\x11JointCommandValue\x12\x12\n\njoint_name\x18\x01 \x01(\t\x12\x0e\n\x06torque\x18\x02 \x01(\x02\x12\x10\n\x08velocity\x18\x03 \x01(\x02\x12\x10\n\x08position\x18\x04 \x01(\x02\x12\n\n\x02kp\x18\x05 \x01(\x02\x12\n\n\x02kd\x18\x06 \x01(\x02\x12\x32\n\x0btorque_unit\x18\x07 \x01(\x0e\x32\x1d.kinfer.proto.JointTorqueUnit\x12\x36\n\rvelocity_unit\x18\x08 \x01(\x0e\x32\x1f.kinfer.proto.JointVelocityUnit\x12\x36\n\rposition_unit\x18\t \x01(\x0e\x32\x1f.kinfer.proto.JointPositionUnit\"E\n\x12JointCommandsValue\x12/\n\x06values\x18\x01 \x03(\x0b\x32\x1f.kinfer.proto.JointCommandValue\"D\n\x11\x43\x61meraFrameSchema\x12\r\n\x05width\x18\x01 \x01(\x05\x12\x0e\n\x06height\x18\x02 \x01(\x05\x12\x10\n\x08\x63hannels\x18\x03 \x01(\x05\" \n\x10\x43\x61meraFrameValue\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"]\n\x10\x41udioFrameSchema\x12\x10\n\x08\x63hannels\x18\x01 \x01(\x05\x12\x13\n\x0bsample_rate\x18\x02 \x01(\x05\x12\"\n\x05\x64type\x18\x03 \x01(\x0e\x32\x13.kinfer.proto.DType\"\x1f\n\x0f\x41udioFrameValue\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"8\n\x15ImuAccelerometerValue\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"4\n\x11ImuGyroscopeValue\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"7\n\x14ImuMagnetometerValue\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\"W\n\tImuSchema\x12\x19\n\x11use_accelerometer\x18\x01 \x01(\x08\x12\x15\n\ruse_gyroscope\x18\x02 \x01(\x08\x12\x18\n\x10use_magnetometer\x18\x03 \x01(\x08\"\xc3\x01\n\x08ImuValue\x12@\n\x13linear_acceleration\x18\x01 \x01(\x0b\x32#.kinfer.proto.ImuAccelerometerValue\x12\x39\n\x10\x61ngular_velocity\x18\x02 \x01(\x0b\x32\x1f.kinfer.proto.ImuGyroscopeValue\x12:\n\x0emagnetic_field\x18\x03 \x01(\x0b\x32\".kinfer.proto.ImuMagnetometerValue\"=\n\x0fTimestampSchema\x12\x15\n\rstart_seconds\x18\x01 \x01(\x03\x12\x13\n\x0bstart_nanos\x18\x02 \x01(\x05\"0\n\x0eTimestampValue\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x12\r\n\x05nanos\x18\x02 \x01(\x05\")\n\x13VectorCommandSchema\x12\x12\n\ndimensions\x18\x01 \x01(\x05\"$\n\x12VectorCommandValue\x12\x0e\n\x06values\x18\x01 \x03(\x02\"F\n\x11StateTensorSchema\x12\r\n\x05shape\x18\x01 \x03(\x05\x12\"\n\x05\x64type\x18\x02 \x01(\x0e\x32\x13.kinfer.proto.DType\" \n\x10StateTensorValue\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"\xd4\x04\n\x05Value\x12\x12\n\nvalue_name\x18\x01 \x01(\t\x12<\n\x0fjoint_positions\x18\x02 \x01(\x0b\x32!.kinfer.proto.JointPositionsValueH\x00\x12>\n\x10joint_velocities\x18\x03 \x01(\x0b\x32\".kinfer.proto.JointVelocitiesValueH\x00\x12\x38\n\rjoint_torques\x18\x04 \x01(\x0b\x32\x1f.kinfer.proto.JointTorquesValueH\x00\x12:\n\x0ejoint_commands\x18\x05 \x01(\x0b\x32 .kinfer.proto.JointCommandsValueH\x00\x12\x36\n\x0c\x63\x61mera_frame\x18\x06 \x01(\x0b\x32\x1e.kinfer.proto.CameraFrameValueH\x00\x12\x34\n\x0b\x61udio_frame\x18\x07 \x01(\x0b\x32\x1d.kinfer.proto.AudioFrameValueH\x00\x12%\n\x03imu\x18\x08 \x01(\x0b\x32\x16.kinfer.proto.ImuValueH\x00\x12\x31\n\ttimestamp\x18\t \x01(\x0b\x32\x1c.kinfer.proto.TimestampValueH\x00\x12:\n\x0evector_command\x18\n \x01(\x0b\x32 .kinfer.proto.VectorCommandValueH\x00\x12\x36\n\x0cstate_tensor\x18\x0b \x01(\x0b\x32\x1e.kinfer.proto.StateTensorValueH\x00\x42\x07\n\x05value\"\xe9\x04\n\x0bValueSchema\x12\x12\n\nvalue_name\x18\x01 \x01(\t\x12=\n\x0fjoint_positions\x18\x02 \x01(\x0b\x32\".kinfer.proto.JointPositionsSchemaH\x00\x12?\n\x10joint_velocities\x18\x03 \x01(\x0b\x32#.kinfer.proto.JointVelocitiesSchemaH\x00\x12\x39\n\rjoint_torques\x18\x04 \x01(\x0b\x32 .kinfer.proto.JointTorquesSchemaH\x00\x12;\n\x0ejoint_commands\x18\x05 \x01(\x0b\x32!.kinfer.proto.JointCommandsSchemaH\x00\x12\x37\n\x0c\x63\x61mera_frame\x18\x06 \x01(\x0b\x32\x1f.kinfer.proto.CameraFrameSchemaH\x00\x12\x35\n\x0b\x61udio_frame\x18\x07 \x01(\x0b\x32\x1e.kinfer.proto.AudioFrameSchemaH\x00\x12&\n\x03imu\x18\x08 \x01(\x0b\x32\x17.kinfer.proto.ImuSchemaH\x00\x12\x32\n\ttimestamp\x18\t \x01(\x0b\x32\x1d.kinfer.proto.TimestampSchemaH\x00\x12;\n\x0evector_command\x18\n \x01(\x0b\x32!.kinfer.proto.VectorCommandSchemaH\x00\x12\x37\n\x0cstate_tensor\x18\x0b \x01(\x0b\x32\x1f.kinfer.proto.StateTensorSchemaH\x00\x42\x0c\n\nvalue_type\"5\n\x08IOSchema\x12)\n\x06values\x18\x01 \x03(\x0b\x32\x19.kinfer.proto.ValueSchema\")\n\x02IO\x12#\n\x06values\x18\x01 \x03(\x0b\x32\x13.kinfer.proto.Value\"j\n\x0bModelSchema\x12,\n\x0cinput_schema\x18\x01 \x01(\x0b\x32\x16.kinfer.proto.IOSchema\x12-\n\routput_schema\x18\x02 \x01(\x0b\x32\x16.kinfer.proto.IOSchema*\x88\x01\n\x05\x44Type\x12\x07\n\x03\x46P8\x10\x00\x12\x08\n\x04\x46P16\x10\x01\x12\x08\n\x04\x46P32\x10\x02\x12\x08\n\x04\x46P64\x10\x03\x12\x08\n\x04INT8\x10\x04\x12\t\n\x05INT16\x10\x05\x12\t\n\x05INT32\x10\x06\x12\t\n\x05INT64\x10\x07\x12\t\n\x05UINT8\x10\x08\x12\n\n\x06UINT16\x10\t\x12\n\n\x06UINT32\x10\n\x12\n\n\x06UINT64\x10\x0b*-\n\x11JointPositionUnit\x12\x0b\n\x07\x44\x45GREES\x10\x00\x12\x0b\n\x07RADIANS\x10\x01*C\n\x11JointVelocityUnit\x12\x16\n\x12\x44\x45GREES_PER_SECOND\x10\x00\x12\x16\n\x12RADIANS_PER_SECOND\x10\x01*$\n\x0fJointTorqueUnit\x12\x11\n\rNEWTON_METERS\x10\x00\x62\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kinfer_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_DTYPE']._serialized_start=3803
35
+ _globals['_DTYPE']._serialized_end=3939
36
+ _globals['_JOINTPOSITIONUNIT']._serialized_start=3941
37
+ _globals['_JOINTPOSITIONUNIT']._serialized_end=3986
38
+ _globals['_JOINTVELOCITYUNIT']._serialized_start=3988
39
+ _globals['_JOINTVELOCITYUNIT']._serialized_end=4055
40
+ _globals['_JOINTTORQUEUNIT']._serialized_start=4057
41
+ _globals['_JOINTTORQUEUNIT']._serialized_end=4093
42
+ _globals['_JOINTPOSITIONVALUE']._serialized_start=30
43
+ _globals['_JOINTPOSITIONVALUE']._serialized_end=132
44
+ _globals['_JOINTPOSITIONSSCHEMA']._serialized_start=134
45
+ _globals['_JOINTPOSITIONSSCHEMA']._serialized_end=224
46
+ _globals['_JOINTPOSITIONSVALUE']._serialized_start=226
47
+ _globals['_JOINTPOSITIONSVALUE']._serialized_end=297
48
+ _globals['_JOINTVELOCITYVALUE']._serialized_start=299
49
+ _globals['_JOINTVELOCITYVALUE']._serialized_end=401
50
+ _globals['_JOINTVELOCITIESSCHEMA']._serialized_start=403
51
+ _globals['_JOINTVELOCITIESSCHEMA']._serialized_end=494
52
+ _globals['_JOINTVELOCITIESVALUE']._serialized_start=496
53
+ _globals['_JOINTVELOCITIESVALUE']._serialized_end=568
54
+ _globals['_JOINTTORQUEVALUE']._serialized_start=570
55
+ _globals['_JOINTTORQUEVALUE']._serialized_end=668
56
+ _globals['_JOINTTORQUESSCHEMA']._serialized_start=670
57
+ _globals['_JOINTTORQUESSCHEMA']._serialized_end=756
58
+ _globals['_JOINTTORQUESVALUE']._serialized_start=758
59
+ _globals['_JOINTTORQUESVALUE']._serialized_end=825
60
+ _globals['_JOINTCOMMANDSSCHEMA']._serialized_start=828
61
+ _globals['_JOINTCOMMANDSSCHEMA']._serialized_end=1034
62
+ _globals['_JOINTCOMMANDVALUE']._serialized_start=1037
63
+ _globals['_JOINTCOMMANDVALUE']._serialized_end=1316
64
+ _globals['_JOINTCOMMANDSVALUE']._serialized_start=1318
65
+ _globals['_JOINTCOMMANDSVALUE']._serialized_end=1387
66
+ _globals['_CAMERAFRAMESCHEMA']._serialized_start=1389
67
+ _globals['_CAMERAFRAMESCHEMA']._serialized_end=1457
68
+ _globals['_CAMERAFRAMEVALUE']._serialized_start=1459
69
+ _globals['_CAMERAFRAMEVALUE']._serialized_end=1491
70
+ _globals['_AUDIOFRAMESCHEMA']._serialized_start=1493
71
+ _globals['_AUDIOFRAMESCHEMA']._serialized_end=1586
72
+ _globals['_AUDIOFRAMEVALUE']._serialized_start=1588
73
+ _globals['_AUDIOFRAMEVALUE']._serialized_end=1619
74
+ _globals['_IMUACCELEROMETERVALUE']._serialized_start=1621
75
+ _globals['_IMUACCELEROMETERVALUE']._serialized_end=1677
76
+ _globals['_IMUGYROSCOPEVALUE']._serialized_start=1679
77
+ _globals['_IMUGYROSCOPEVALUE']._serialized_end=1731
78
+ _globals['_IMUMAGNETOMETERVALUE']._serialized_start=1733
79
+ _globals['_IMUMAGNETOMETERVALUE']._serialized_end=1788
80
+ _globals['_IMUSCHEMA']._serialized_start=1790
81
+ _globals['_IMUSCHEMA']._serialized_end=1877
82
+ _globals['_IMUVALUE']._serialized_start=1880
83
+ _globals['_IMUVALUE']._serialized_end=2075
84
+ _globals['_TIMESTAMPSCHEMA']._serialized_start=2077
85
+ _globals['_TIMESTAMPSCHEMA']._serialized_end=2138
86
+ _globals['_TIMESTAMPVALUE']._serialized_start=2140
87
+ _globals['_TIMESTAMPVALUE']._serialized_end=2188
88
+ _globals['_VECTORCOMMANDSCHEMA']._serialized_start=2190
89
+ _globals['_VECTORCOMMANDSCHEMA']._serialized_end=2231
90
+ _globals['_VECTORCOMMANDVALUE']._serialized_start=2233
91
+ _globals['_VECTORCOMMANDVALUE']._serialized_end=2269
92
+ _globals['_STATETENSORSCHEMA']._serialized_start=2271
93
+ _globals['_STATETENSORSCHEMA']._serialized_end=2341
94
+ _globals['_STATETENSORVALUE']._serialized_start=2343
95
+ _globals['_STATETENSORVALUE']._serialized_end=2375
96
+ _globals['_VALUE']._serialized_start=2378
97
+ _globals['_VALUE']._serialized_end=2974
98
+ _globals['_VALUESCHEMA']._serialized_start=2977
99
+ _globals['_VALUESCHEMA']._serialized_end=3594
100
+ _globals['_IOSCHEMA']._serialized_start=3596
101
+ _globals['_IOSCHEMA']._serialized_end=3649
102
+ _globals['_IO']._serialized_start=3651
103
+ _globals['_IO']._serialized_end=3692
104
+ _globals['_MODELSCHEMA']._serialized_start=3694
105
+ _globals['_MODELSCHEMA']._serialized_end=3800
106
+ # @@protoc_insertion_point(module_scope)