kinfer 0.0.5__tar.gz → 0.3.1__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 (61) hide show
  1. kinfer-0.3.1/Cargo.toml +18 -0
  2. kinfer-0.3.1/MANIFEST.in +2 -0
  3. kinfer-0.3.1/PKG-INFO +57 -0
  4. kinfer-0.3.1/README.md +36 -0
  5. kinfer-0.3.1/kinfer/__init__.py +6 -0
  6. kinfer-0.3.1/kinfer/export/pytorch.py +128 -0
  7. kinfer-0.3.1/kinfer/inference/python.py +92 -0
  8. kinfer-0.3.1/kinfer/proto/__init__.py +40 -0
  9. kinfer-0.3.1/kinfer/proto/kinfer_pb2.py +103 -0
  10. kinfer-0.3.1/kinfer/proto/kinfer_pb2.pyi +1097 -0
  11. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer/requirements-dev.txt +1 -0
  12. kinfer-0.3.1/kinfer/requirements.txt +9 -0
  13. kinfer-0.3.1/kinfer/rust/Cargo.toml +20 -0
  14. kinfer-0.3.1/kinfer/rust/build.rs +16 -0
  15. kinfer-0.3.1/kinfer/rust/src/kinfer_proto.rs +14 -0
  16. kinfer-0.3.1/kinfer/rust/src/lib.rs +14 -0
  17. kinfer-0.3.1/kinfer/rust/src/main.rs +6 -0
  18. kinfer-0.3.1/kinfer/rust/src/model.rs +153 -0
  19. kinfer-0.3.1/kinfer/rust/src/onnx_serializer.rs +804 -0
  20. kinfer-0.3.1/kinfer/rust/src/serializer.rs +221 -0
  21. kinfer-0.3.1/kinfer/rust/src/tests/onnx_serializer_tests.rs +212 -0
  22. kinfer-0.3.1/kinfer/rust_bindings/Cargo.toml +19 -0
  23. kinfer-0.3.1/kinfer/rust_bindings/pyproject.toml +7 -0
  24. kinfer-0.3.1/kinfer/rust_bindings/src/bin/stub_gen.rs +7 -0
  25. kinfer-0.3.1/kinfer/rust_bindings/src/lib.rs +17 -0
  26. kinfer-0.3.1/kinfer/rust_bindings.pyi +7 -0
  27. kinfer-0.3.1/kinfer/serialize/__init__.py +36 -0
  28. kinfer-0.3.1/kinfer/serialize/base.py +536 -0
  29. kinfer-0.3.1/kinfer/serialize/json.py +399 -0
  30. kinfer-0.3.1/kinfer/serialize/numpy.py +426 -0
  31. kinfer-0.3.1/kinfer/serialize/pytorch.py +402 -0
  32. kinfer-0.3.1/kinfer/serialize/schema.py +125 -0
  33. kinfer-0.3.1/kinfer/serialize/types.py +17 -0
  34. kinfer-0.3.1/kinfer/serialize/utils.py +177 -0
  35. kinfer-0.3.1/kinfer.egg-info/PKG-INFO +57 -0
  36. kinfer-0.3.1/kinfer.egg-info/SOURCES.txt +47 -0
  37. kinfer-0.3.1/kinfer.egg-info/not-zip-safe +1 -0
  38. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer.egg-info/requires.txt +2 -0
  39. {kinfer-0.0.5 → kinfer-0.3.1}/pyproject.toml +23 -6
  40. kinfer-0.3.1/setup.py +85 -0
  41. kinfer-0.3.1/tests/test_infer.py +101 -0
  42. kinfer-0.3.1/tests/test_schema.py +229 -0
  43. kinfer-0.0.5/MANIFEST.in +0 -1
  44. kinfer-0.0.5/PKG-INFO +0 -22
  45. kinfer-0.0.5/README.md +0 -3
  46. kinfer-0.0.5/kinfer/__init__.py +0 -3
  47. kinfer-0.0.5/kinfer/export/pytorch.py +0 -224
  48. kinfer-0.0.5/kinfer/inference/python.py +0 -117
  49. kinfer-0.0.5/kinfer/requirements.txt +0 -5
  50. kinfer-0.0.5/kinfer.egg-info/PKG-INFO +0 -22
  51. kinfer-0.0.5/kinfer.egg-info/SOURCES.txt +0 -20
  52. kinfer-0.0.5/setup.py +0 -46
  53. kinfer-0.0.5/tests/test_dummy.py +0 -12
  54. kinfer-0.0.5/tests/test_infer.py +0 -193
  55. {kinfer-0.0.5 → kinfer-0.3.1}/LICENSE +0 -0
  56. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer/export/__init__.py +0 -0
  57. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer/inference/__init__.py +0 -0
  58. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer/py.typed +0 -0
  59. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer.egg-info/dependency_links.txt +0 -0
  60. {kinfer-0.0.5 → kinfer-0.3.1}/kinfer.egg-info/top_level.txt +0 -0
  61. {kinfer-0.0.5 → kinfer-0.3.1}/setup.cfg +0 -0
@@ -0,0 +1,18 @@
1
+ [workspace]
2
+
3
+ members = [
4
+ "kinfer/rust",
5
+ "kinfer/rust_bindings",
6
+ ]
7
+ resolver = "2"
8
+
9
+ [workspace.package]
10
+
11
+ version = "0.3.1"
12
+ authors = ["Wesley Maa <wesley@kscale.dev>", "Benjamin Bolte <ben@kscale.dev>"]
13
+ edition = "2021"
14
+ description = "K-Scale Inference Library"
15
+ license = "MIT"
16
+ repository = "https://github.com/kscalelabs/kinfer"
17
+ documentation = "https://docs.kscale.dev"
18
+ readme = "README.md"
@@ -0,0 +1,2 @@
1
+ include Cargo.toml
2
+ recursive-include kinfer/ *.rs *.pyi *.so *.py *.txt *.md *.toml py.typed
kinfer-0.3.1/PKG-INFO ADDED
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.1
2
+ Name: kinfer
3
+ Version: 0.3.1
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
+ ```
52
+
53
+ ### Considerations for Exporting PyTorch Models
54
+
55
+ Don't use common names for the inputs to your forward pass. E.g. `input`, `output`, `state`, `state_tensor`, `buffer`, etc.
56
+
57
+ This is because ONNX has internal names for the model and if there's a conflict, the inputs will have a .1, .2, etc. suffix which makes it really hard to figure out what value_name to pass into your kinfer io values.
kinfer-0.3.1/README.md ADDED
@@ -0,0 +1,36 @@
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
+ ```
31
+
32
+ ### Considerations for Exporting PyTorch Models
33
+
34
+ Don't use common names for the inputs to your forward pass. E.g. `input`, `output`, `state`, `state_tensor`, `buffer`, etc.
35
+
36
+ This is because ONNX has internal names for the model and if there's a conflict, the inputs will have a .1, .2, etc. suffix which makes it really hard to figure out what value_name to pass into your kinfer io values.
@@ -0,0 +1,6 @@
1
+ """Defines the kinfer API."""
2
+
3
+ from . import export, inference
4
+ from .rust_bindings import get_version
5
+
6
+ __version__ = get_version()
@@ -0,0 +1,128 @@
1
+ """PyTorch model export utilities."""
2
+
3
+ import base64
4
+ import inspect
5
+ from io import BytesIO
6
+ from typing import Sequence
7
+
8
+ import onnx
9
+ import onnxruntime as ort
10
+ import torch
11
+ from torch import Tensor
12
+
13
+ from kinfer import proto as P
14
+ from kinfer.serialize.pytorch import PyTorchMultiSerializer
15
+ from kinfer.serialize.schema import get_dummy_io
16
+ from kinfer.serialize.utils import check_names_match
17
+
18
+ KINFER_METADATA_KEY = "kinfer_metadata"
19
+
20
+
21
+ def _add_metadata_to_onnx(model_proto: onnx.ModelProto, schema: P.ModelSchema) -> onnx.ModelProto:
22
+ """Add metadata to ONNX model.
23
+
24
+ Args:
25
+ model_proto: ONNX model prototype
26
+ schema: Model schema to use for model export.
27
+
28
+ Returns:
29
+ ONNX model with added metadata
30
+ """
31
+ schema_bytes = schema.SerializeToString()
32
+
33
+ meta = model_proto.metadata_props.add()
34
+ meta.key = KINFER_METADATA_KEY
35
+ meta.value = base64.b64encode(schema_bytes).decode("utf-8")
36
+
37
+ return model_proto
38
+
39
+
40
+ def export_model(model: torch.jit.ScriptModule, schema: P.ModelSchema) -> 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
+
60
+ if model_input_names != input_schema_names:
61
+ raise ValueError(f"Expected input names {model_input_names} to match schema names {input_schema_names}")
62
+
63
+ input_serializer = PyTorchMultiSerializer(schema.input_schema)
64
+ output_serializer = PyTorchMultiSerializer(schema.output_schema)
65
+
66
+ input_dummy_values = get_dummy_io(schema.input_schema)
67
+ input_tensors = input_serializer.serialize_io(input_dummy_values, as_dict=True)
68
+
69
+ check_names_match("model_input_names", model_input_names, "input_schema", list(input_tensors.keys()))
70
+ input_tensor_list = [input_tensors[name] for name in model_input_names]
71
+
72
+ # Attempts to run the model with the dummy inputs.
73
+ try:
74
+ pred_output_tensors = model(*input_tensor_list)
75
+ except Exception as e:
76
+ signature = inspect.signature(model.forward)
77
+ model_input_names = [
78
+ p.name for p in signature.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD
79
+ ]
80
+
81
+ raise ValueError(
82
+ f"Failed to run model with dummy inputs; input names are {model_input_names} while "
83
+ f"input schema is {schema.input_schema}"
84
+ ) from e
85
+
86
+ # Attempts to parse the output tensors using the output schema.
87
+ if isinstance(pred_output_tensors, Tensor):
88
+ pred_output_tensors = (pred_output_tensors,)
89
+ if isinstance(pred_output_tensors, Sequence):
90
+ pred_output_tensors = output_serializer.assign_names(pred_output_tensors)
91
+ if not isinstance(pred_output_tensors, dict):
92
+ raise ValueError("Output tensors could not be converted to dictionary")
93
+ try:
94
+ pred_output_tensors = output_serializer.deserialize_io(pred_output_tensors)
95
+ except Exception as e:
96
+ raise ValueError("Failed to parse output tensors using output schema; are you sure it is correct?") from e
97
+
98
+ # Export model to buffer
99
+ buffer = BytesIO()
100
+ torch.onnx.export(
101
+ model=model,
102
+ f=buffer, # type: ignore[arg-type]
103
+ kwargs=input_tensors,
104
+ input_names=input_schema_names,
105
+ output_names=output_schema_names,
106
+ )
107
+ buffer.seek(0)
108
+
109
+ # Loads the model from the buffer and adds metadata.
110
+ model_proto = onnx.load_model(buffer)
111
+ model_proto = _add_metadata_to_onnx(model_proto, schema)
112
+
113
+ return model_proto
114
+
115
+
116
+ def get_model(model_proto: onnx.ModelProto) -> ort.InferenceSession:
117
+ """Converts a model proto to an inference session.
118
+
119
+ Args:
120
+ model_proto: ONNX model proto to convert to inference session.
121
+
122
+ Returns:
123
+ ONNX inference session
124
+ """
125
+ buffer = BytesIO()
126
+ onnx.save_model(model_proto, buffer)
127
+ buffer.seek(0)
128
+ return ort.InferenceSession(buffer.read())
@@ -0,0 +1,92 @@
1
+ """ONNX model inference utilities for Python."""
2
+
3
+ import base64
4
+ from pathlib import Path
5
+
6
+ import onnx
7
+ import onnxruntime as ort
8
+
9
+ from kinfer import proto as P
10
+ from kinfer.export.pytorch import KINFER_METADATA_KEY
11
+ from kinfer.serialize.numpy import NumpyMultiSerializer
12
+
13
+
14
+ def _read_schema(model: onnx.ModelProto) -> P.ModelSchema:
15
+ for prop in model.metadata_props:
16
+ if prop.key == KINFER_METADATA_KEY:
17
+ try:
18
+ schema_bytes = base64.b64decode(prop.value)
19
+ schema = P.ModelSchema()
20
+ schema.ParseFromString(schema_bytes)
21
+ return schema
22
+ except Exception as e:
23
+ raise ValueError("Failed to parse kinfer_metadata value") from e
24
+ else:
25
+ raise ValueError(f"Found arbitrary metadata key {prop.key}")
26
+
27
+ raise ValueError(f"{KINFER_METADATA_KEY} not found in model metadata")
28
+
29
+
30
+ class ONNXModel:
31
+ """Wrapper for ONNX model inference."""
32
+
33
+ def __init__(self: "ONNXModel", model_path: str | Path) -> None:
34
+ """Initialize ONNX model.
35
+
36
+ Args:
37
+ model_path: Path to ONNX model file
38
+ """
39
+ self.model_path = model_path
40
+
41
+ # Load model and create inference session
42
+ self.model = onnx.load(model_path)
43
+ self.session = ort.InferenceSession(model_path)
44
+ self._schema = _read_schema(self.model)
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: "ONNXModel", 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: "ONNXModel") -> P.IOSchema:
66
+ """Get the input schema."""
67
+ return self._schema.input_schema
68
+
69
+ @property
70
+ def output_schema(self: "ONNXModel") -> P.IOSchema:
71
+ """Get the output schema."""
72
+ return self._schema.output_schema
73
+
74
+ @property
75
+ def schema_input_keys(self: "ONNXModel") -> list[str]:
76
+ """Get all value names from input schemas.
77
+
78
+ Returns:
79
+ List of value names from input schema.
80
+ """
81
+ input_names = [value.value_name for value in self._schema.input_schema.values]
82
+ return input_names
83
+
84
+ @property
85
+ def schema_output_keys(self: "ONNXModel") -> list[str]:
86
+ """Get all value names from output schemas.
87
+
88
+ Returns:
89
+ List of value names from output schema.
90
+ """
91
+ output_names = [value.value_name for value in self._schema.output_schema.values]
92
+ return output_names
@@ -0,0 +1,40 @@
1
+ """Defines helper types for the protocol buffers."""
2
+
3
+ from .kinfer_pb2 import (
4
+ IO,
5
+ AudioFrameSchema,
6
+ AudioFrameValue,
7
+ CameraFrameSchema,
8
+ CameraFrameValue,
9
+ DType,
10
+ ImuAccelerometerValue,
11
+ ImuGyroscopeValue,
12
+ ImuMagnetometerValue,
13
+ ImuSchema,
14
+ ImuValue,
15
+ IOSchema,
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,103 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: kinfer/proto/kinfer.proto
5
+ # Protobuf Python Version: 5.29.1
6
+ """Generated protocol buffer code."""
7
+
8
+ from google.protobuf import descriptor as _descriptor
9
+ from google.protobuf import descriptor_pool as _descriptor_pool
10
+ from google.protobuf import runtime_version as _runtime_version
11
+ from google.protobuf import symbol_database as _symbol_database
12
+ from google.protobuf.internal import builder as _builder
13
+
14
+ _runtime_version.ValidateProtobufRuntimeVersion(
15
+ _runtime_version.Domain.PUBLIC, 5, 29, 1, "", "kinfer/proto/kinfer.proto"
16
+ )
17
+ # @@protoc_insertion_point(imports)
18
+
19
+ _sym_db = _symbol_database.Default()
20
+
21
+
22
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
23
+ b'\n\x19kinfer/proto/kinfer.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'
24
+ )
25
+
26
+ _globals = globals()
27
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
28
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "kinfer.proto.kinfer_pb2", _globals)
29
+ if not _descriptor._USE_C_DESCRIPTORS:
30
+ DESCRIPTOR._loaded_options = None
31
+ _globals["_DTYPE"]._serialized_start = 3816
32
+ _globals["_DTYPE"]._serialized_end = 3952
33
+ _globals["_JOINTPOSITIONUNIT"]._serialized_start = 3954
34
+ _globals["_JOINTPOSITIONUNIT"]._serialized_end = 3999
35
+ _globals["_JOINTVELOCITYUNIT"]._serialized_start = 4001
36
+ _globals["_JOINTVELOCITYUNIT"]._serialized_end = 4068
37
+ _globals["_JOINTTORQUEUNIT"]._serialized_start = 4070
38
+ _globals["_JOINTTORQUEUNIT"]._serialized_end = 4106
39
+ _globals["_JOINTPOSITIONVALUE"]._serialized_start = 43
40
+ _globals["_JOINTPOSITIONVALUE"]._serialized_end = 145
41
+ _globals["_JOINTPOSITIONSSCHEMA"]._serialized_start = 147
42
+ _globals["_JOINTPOSITIONSSCHEMA"]._serialized_end = 237
43
+ _globals["_JOINTPOSITIONSVALUE"]._serialized_start = 239
44
+ _globals["_JOINTPOSITIONSVALUE"]._serialized_end = 310
45
+ _globals["_JOINTVELOCITYVALUE"]._serialized_start = 312
46
+ _globals["_JOINTVELOCITYVALUE"]._serialized_end = 414
47
+ _globals["_JOINTVELOCITIESSCHEMA"]._serialized_start = 416
48
+ _globals["_JOINTVELOCITIESSCHEMA"]._serialized_end = 507
49
+ _globals["_JOINTVELOCITIESVALUE"]._serialized_start = 509
50
+ _globals["_JOINTVELOCITIESVALUE"]._serialized_end = 581
51
+ _globals["_JOINTTORQUEVALUE"]._serialized_start = 583
52
+ _globals["_JOINTTORQUEVALUE"]._serialized_end = 681
53
+ _globals["_JOINTTORQUESSCHEMA"]._serialized_start = 683
54
+ _globals["_JOINTTORQUESSCHEMA"]._serialized_end = 769
55
+ _globals["_JOINTTORQUESVALUE"]._serialized_start = 771
56
+ _globals["_JOINTTORQUESVALUE"]._serialized_end = 838
57
+ _globals["_JOINTCOMMANDSSCHEMA"]._serialized_start = 841
58
+ _globals["_JOINTCOMMANDSSCHEMA"]._serialized_end = 1047
59
+ _globals["_JOINTCOMMANDVALUE"]._serialized_start = 1050
60
+ _globals["_JOINTCOMMANDVALUE"]._serialized_end = 1329
61
+ _globals["_JOINTCOMMANDSVALUE"]._serialized_start = 1331
62
+ _globals["_JOINTCOMMANDSVALUE"]._serialized_end = 1400
63
+ _globals["_CAMERAFRAMESCHEMA"]._serialized_start = 1402
64
+ _globals["_CAMERAFRAMESCHEMA"]._serialized_end = 1470
65
+ _globals["_CAMERAFRAMEVALUE"]._serialized_start = 1472
66
+ _globals["_CAMERAFRAMEVALUE"]._serialized_end = 1504
67
+ _globals["_AUDIOFRAMESCHEMA"]._serialized_start = 1506
68
+ _globals["_AUDIOFRAMESCHEMA"]._serialized_end = 1599
69
+ _globals["_AUDIOFRAMEVALUE"]._serialized_start = 1601
70
+ _globals["_AUDIOFRAMEVALUE"]._serialized_end = 1632
71
+ _globals["_IMUACCELEROMETERVALUE"]._serialized_start = 1634
72
+ _globals["_IMUACCELEROMETERVALUE"]._serialized_end = 1690
73
+ _globals["_IMUGYROSCOPEVALUE"]._serialized_start = 1692
74
+ _globals["_IMUGYROSCOPEVALUE"]._serialized_end = 1744
75
+ _globals["_IMUMAGNETOMETERVALUE"]._serialized_start = 1746
76
+ _globals["_IMUMAGNETOMETERVALUE"]._serialized_end = 1801
77
+ _globals["_IMUSCHEMA"]._serialized_start = 1803
78
+ _globals["_IMUSCHEMA"]._serialized_end = 1890
79
+ _globals["_IMUVALUE"]._serialized_start = 1893
80
+ _globals["_IMUVALUE"]._serialized_end = 2088
81
+ _globals["_TIMESTAMPSCHEMA"]._serialized_start = 2090
82
+ _globals["_TIMESTAMPSCHEMA"]._serialized_end = 2151
83
+ _globals["_TIMESTAMPVALUE"]._serialized_start = 2153
84
+ _globals["_TIMESTAMPVALUE"]._serialized_end = 2201
85
+ _globals["_VECTORCOMMANDSCHEMA"]._serialized_start = 2203
86
+ _globals["_VECTORCOMMANDSCHEMA"]._serialized_end = 2244
87
+ _globals["_VECTORCOMMANDVALUE"]._serialized_start = 2246
88
+ _globals["_VECTORCOMMANDVALUE"]._serialized_end = 2282
89
+ _globals["_STATETENSORSCHEMA"]._serialized_start = 2284
90
+ _globals["_STATETENSORSCHEMA"]._serialized_end = 2354
91
+ _globals["_STATETENSORVALUE"]._serialized_start = 2356
92
+ _globals["_STATETENSORVALUE"]._serialized_end = 2388
93
+ _globals["_VALUE"]._serialized_start = 2391
94
+ _globals["_VALUE"]._serialized_end = 2987
95
+ _globals["_VALUESCHEMA"]._serialized_start = 2990
96
+ _globals["_VALUESCHEMA"]._serialized_end = 3607
97
+ _globals["_IOSCHEMA"]._serialized_start = 3609
98
+ _globals["_IOSCHEMA"]._serialized_end = 3662
99
+ _globals["_IO"]._serialized_start = 3664
100
+ _globals["_IO"]._serialized_end = 3705
101
+ _globals["_MODELSCHEMA"]._serialized_start = 3707
102
+ _globals["_MODELSCHEMA"]._serialized_end = 3813
103
+ # @@protoc_insertion_point(module_scope)