sequence-base 0.8.2__tar.gz → 0.8.3__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.
- {sequence_base-0.8.2 → sequence_base-0.8.3}/PKG-INFO +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/pyproject.toml +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/by_name.py +23 -10
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/codec/marked.py +20 -3
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/constants/serving.py +12 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/constants/version.py +5 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/benchmarks.py +1 -6
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/deployments.py +9 -16
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/eval.py +0 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/policy.py +17 -16
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/settings.py +27 -24
- sequence_base-0.8.3/sequence_base/episode.py +85 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/presets/robot_arm.py +1 -34
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ActRequest.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ActResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ActionChunk.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ActionContract.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ActionStep.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/AdapterPair.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/AddLocal.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Autoscaler.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/BenchmarkRegisterRequest.json +1 -26
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/BenchmarkSpec.json +2 -15
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/BenchmarkStatusResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/BootstrapResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Camera.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/CodeBundle.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Concurrency.json +2 -2
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/DeploymentAccepted.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/DeploymentPolicy.json +6 -18
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/DeploymentRequest.json +8 -32
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/DeploymentStatusResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ErrorBody.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ErrorCodes.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Estimate.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/EvalDryRunResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/EvalReport.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/EvalRequest.json +1 -14
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/EvalResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageFrame.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageSpec.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepAddLocal.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepApt.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepEnv.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepProject.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepRun.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepTemplateFiles.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ImageStepUvPip.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/InferParam.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Lease.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/MetricAgg.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Observation.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ObservationContract.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ObserveRequest.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ObserveResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlanAppend.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlanAppended.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerMember.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerObservation.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerObserve.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerObserved.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerPlanIn.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerPlans.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerPlansWritten.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerRobot.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerRound.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerRoundRequest.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PlannerSpec.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PolicyRegistration.json +14 -26
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/PolicySpec.json +12 -24
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Project.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Proprioception.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/ReplaySpec.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Resources.json +2 -2
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/RolloutResult.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SecretCreateRequest.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SecretInfo.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SecretRef.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SeqFlags.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SettingsChange.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SettingsChanged.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/SettingsView.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/TaskAgg.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/TemplateFiles.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Tensors.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/Timeouts.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/UploadTarget.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/VolumeFile.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/VolumeInfo.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/VolumeMount.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/VolumeRef.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/VolumeUploadRequest.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/VolumeUploadResponse.json +1 -1
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schemas/WarmingError.json +1 -1
- sequence_base-0.8.2/sequence_base/episode.py +0 -58
- {sequence_base-0.8.2 → sequence_base-0.8.3}/.gitignore +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/README.md +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/auth.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/codec/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/codec/blocks.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/codec/compressed.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/codec/image.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/constants/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/constants/cards.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/constants/headers.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/constants/limits.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/construct.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/accounts.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/adapters.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/connect.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/errors.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/flags.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/observe.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/own_io.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/planner.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/templates.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/volumes.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/contract/wire.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/errors/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/errors/transport.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/msgpack_io.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/obs/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/obs/log.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/obs/rid.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/presets/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/presets/prompts.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/schema_export.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/telemetry/__init__.py +0 -0
- {sequence_base-0.8.2 → sequence_base-0.8.3}/sequence_base/telemetry/events.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sequence-base
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3
|
|
4
4
|
Summary: Shared foundation for the Sequences platform — wire contract, correlation, error taxonomy, constants. Used by the robot SDK, gateway, and container harness.
|
|
5
5
|
Project-URL: Changelog, https://generalsequences.com/docs/changelog/
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sequence-base"
|
|
3
|
-
version = "0.8.
|
|
3
|
+
version = "0.8.3"
|
|
4
4
|
description = "Shared foundation for the Sequences platform — wire contract, correlation, error taxonomy, constants. Used by the robot SDK, gateway, and container harness."
|
|
5
5
|
requires-python = ">=3.10"
|
|
6
6
|
dependencies = ["pydantic>=2.0"]
|
|
@@ -17,7 +17,8 @@ rule on both sides.
|
|
|
17
17
|
|
|
18
18
|
What the platform hands a method itself is `episode` - an act function, an observe function and the method an
|
|
19
19
|
episode's end calls alike - and an eval's `seed`; `ends(parameters, what)` refuses an end method that needs anything but
|
|
20
|
-
the episode, in words that say what to write instead, when the SDK declares a class
|
|
20
|
+
the episode, in words that say what to write instead, when the SDK declares a class; RESET_GONE is what both say
|
|
21
|
+
of a policy that marks @seq.reset, which @seq.on_episode replaced.
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
|
|
@@ -33,8 +34,8 @@ from collections.abc import Iterable, Mapping
|
|
|
33
34
|
from dataclasses import dataclass
|
|
34
35
|
from typing import Any
|
|
35
36
|
|
|
36
|
-
__all__ = ["INFER_PLATFORM", "OBSERVE_PLATFORM", "WAKE_ON", "ByName", "ends", "plan_refused",
|
|
37
|
-
"wake_on_refused"]
|
|
37
|
+
__all__ = ["INFER_PLATFORM", "OBSERVE_PLATFORM", "RESET_GONE", "WAKE_ON", "ByName", "ends", "plan_refused",
|
|
38
|
+
"takes_by_name", "wake_on_refused"]
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
@@ -105,16 +106,28 @@ def takes_by_name(parameters: Iterable[inspect.Parameter], platform: frozenset[s
|
|
|
105
106
|
|
|
106
107
|
|
|
107
108
|
def ends(parameters: Iterable[inspect.Parameter], what: str) -> str | None:
|
|
108
|
-
"""Why `what` ("Model.
|
|
109
|
-
|
|
110
|
-
when it does.
|
|
111
|
-
|
|
109
|
+
"""Why `what` ("Model.on_episode"), the method an episode's start and end call (@seq.on_episode), cannot be
|
|
110
|
+
deployed: it is handed the episode alone, as the episode begins (episode.phase "start") and as it ends ("end"), so
|
|
111
|
+
it takes `episode` - by name, or **kwargs - and any other argument with a default; or None, when it does. One that
|
|
112
|
+
takes no episode could not tell its start from its end.
|
|
113
|
+
"""
|
|
114
|
+
params = list(parameters)
|
|
115
|
+
taken = [p.name for p in params if p.kind not in _VARIADIC
|
|
112
116
|
and p.name != "episode" and p.default is inspect.Parameter.empty]
|
|
113
|
-
|
|
117
|
+
handed = any(p.name == "episode" or p.kind is inspect.Parameter.VAR_KEYWORD for p in params)
|
|
118
|
+
if handed and not taken:
|
|
114
119
|
return None
|
|
115
120
|
name = what.rsplit(".", 1)[-1]
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
took = f"takes {' and '.join(taken)}" if taken else "takes no episode"
|
|
122
|
+
return (f"{what} {took}: @seq.on_episode runs as an episode begins and as it ends, handed the episode alone - "
|
|
123
|
+
f"write def {name}(self, episode) and read episode.phase ('start' or 'end') and episode.id")
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
RESET_GONE = ("@seq.reset is gone: use @seq.on_episode, which runs as an episode begins (episode.phase == 'start') and "
|
|
130
|
+
"as it ends")
|
|
118
131
|
|
|
119
132
|
|
|
120
133
|
def _keys(names: list) -> str:
|
|
@@ -227,15 +227,32 @@ def _predict(a) -> tuple[str, bytes]:
|
|
|
227
227
|
|
|
228
228
|
|
|
229
229
|
def _unpredict(m: dict):
|
|
230
|
+
"""A depth item back to its array, read only up to what its dtype and shape say - those at most MAX_STREAM_BYTES -
|
|
231
|
+
and refused before its buffer is made when its frame says more: a few KB of zstd can say gigabytes, and the worker
|
|
232
|
+
decodes a robot's item in its policy's process."""
|
|
233
|
+
import math
|
|
234
|
+
|
|
230
235
|
import numpy as np
|
|
231
236
|
import zstandard
|
|
232
237
|
|
|
238
|
+
from sequence_base.constants.limits import MAX_STREAM_BYTES
|
|
239
|
+
|
|
233
240
|
dtype, shape, codec = np.dtype(m["dtype"]), tuple(int(s) for s in m["shape"]), m["codec"]
|
|
234
241
|
size = dtype.itemsize
|
|
242
|
+
want = math.prod(shape) * size
|
|
243
|
+
if codec not in ("zstd-delta", "zstd-xor") or dtype.kind not in "uif" or not shape or min(shape) < 0:
|
|
244
|
+
raise MarkedError(f"a depth map that does not read back: {codec} {m['dtype']} {list(shape)}")
|
|
245
|
+
if want > MAX_STREAM_BYTES:
|
|
246
|
+
raise MarkedError(f"a depth map of {want} bytes ({m['dtype']} {list(shape)}): at most {MAX_STREAM_BYTES}")
|
|
247
|
+
said = zstandard.frame_content_size(m["data"])
|
|
248
|
+
if said not in (-1, want):
|
|
249
|
+
raise MarkedError(f"a depth map whose frame says {said} bytes and whose dtype and shape say {want}")
|
|
235
250
|
cols = shape[-1]
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
251
|
+
try:
|
|
252
|
+
raw = zstandard.ZstdDecompressor().decompress(m["data"], max_output_size=max(want, 1))
|
|
253
|
+
except zstandard.ZstdError as exc:
|
|
254
|
+
raise MarkedError(f"a depth map that does not read back: {exc}") from None
|
|
255
|
+
if len(raw) != want:
|
|
239
256
|
raise MarkedError(f"a depth map that does not read back: {codec} {m['dtype']} {list(shape)}")
|
|
240
257
|
rows = np.frombuffer(raw, np.uint8).reshape(size, -1).T.copy().view(f"<u{size}").reshape(-1, cols)
|
|
241
258
|
if codec == "zstd-xor":
|
|
@@ -19,7 +19,7 @@ from sequence_base.constants.limits import MAX_ENVS, TASK_DESCRIPTION_MAX
|
|
|
19
19
|
from sequence_base.contract.accounts import SecretRef
|
|
20
20
|
from sequence_base.contract.deployments import CodeBundle, DeploymentState, InferParam
|
|
21
21
|
from sequence_base.contract.flags import BENCHMARK_BINDABLE, SeqFlags
|
|
22
|
-
from sequence_base.contract.policy import
|
|
22
|
+
from sequence_base.contract.policy import ImageSpec, PolicyConstructor, VolumeRef
|
|
23
23
|
from sequence_base.construct import FORMS
|
|
24
24
|
|
|
25
25
|
__all__ = [
|
|
@@ -126,8 +126,6 @@ class BenchmarkSpec(BaseModel):
|
|
|
126
126
|
memory_gb: int | None = None
|
|
127
127
|
secrets: list[SecretRef] = Field(default_factory=list)
|
|
128
128
|
|
|
129
|
-
engine: str | None = Field(default=None, pattern=KIND_NAME)
|
|
130
|
-
|
|
131
129
|
|
|
132
130
|
|
|
133
131
|
constructor: PolicyConstructor | None = None
|
|
@@ -178,8 +176,6 @@ class BenchmarkRegisterRequest(BaseModel):
|
|
|
178
176
|
memory_gb: int | None = None
|
|
179
177
|
|
|
180
178
|
code: CodeBundle | None = None
|
|
181
|
-
|
|
182
|
-
freeze: bool | None = None
|
|
183
179
|
secrets: list[SecretRef] = Field(default_factory=list)
|
|
184
180
|
gpu: str | None = Field(default=None, max_length=32)
|
|
185
181
|
|
|
@@ -191,7 +187,6 @@ class BenchmarkRegisterRequest(BaseModel):
|
|
|
191
187
|
params: dict[str, InferParam] | None = Field(default=None, max_length=32)
|
|
192
188
|
|
|
193
189
|
image_context: CodeBundle | None = None
|
|
194
|
-
engine: str | None = Field(default=None, pattern=KIND_NAME)
|
|
195
190
|
|
|
196
191
|
@model_validator(mode="after")
|
|
197
192
|
def _tasks(self) -> "BenchmarkRegisterRequest":
|
|
@@ -24,7 +24,6 @@ from sequence_base.contract.accounts import SecretRef
|
|
|
24
24
|
from sequence_base.contract.own_io import Tensors
|
|
25
25
|
from sequence_base.contract.planner import PLAN_ON_A_POLICY, PlannerSpec
|
|
26
26
|
from sequence_base.contract.policy import (
|
|
27
|
-
KIND_NAME,
|
|
28
27
|
Concurrency,
|
|
29
28
|
Episodes,
|
|
30
29
|
ImageSpec,
|
|
@@ -69,10 +68,12 @@ class Resources(BaseModel):
|
|
|
69
68
|
|
|
70
69
|
|
|
71
70
|
|
|
71
|
+
|
|
72
72
|
region: str | None = Field(default=None, max_length=32,
|
|
73
73
|
description='Where its workers run: "auto" (the default), each robot\'s in the region '
|
|
74
|
-
'nearest it, or
|
|
75
|
-
'
|
|
74
|
+
'nearest it, or one of the platform\'s regions - us-east, us-east-central, '
|
|
75
|
+
'us-southeast, us-central, us-northwest, us-southwest, us-mountain - every '
|
|
76
|
+
'worker there alone. Any other value is refused.')
|
|
76
77
|
|
|
77
78
|
@model_validator(mode="after")
|
|
78
79
|
def _limits_cover_requests(self) -> "Resources":
|
|
@@ -208,13 +209,11 @@ class DeploymentPolicy(BaseModel):
|
|
|
208
209
|
action_chunk_replan_at: int | None = Field(default=None, ge=1, le=100_000)
|
|
209
210
|
|
|
210
211
|
|
|
211
|
-
|
|
212
|
-
secrets: list[SecretRef] = Field(default_factory=list)
|
|
213
|
-
|
|
212
|
+
max_wait_for_batch: float | None = Field(default=None, gt=0, le=60)
|
|
214
213
|
|
|
215
|
-
io: str | None = Field(default=None, max_length=4000)
|
|
216
214
|
|
|
217
|
-
|
|
215
|
+
episodes: Episodes | None = None
|
|
216
|
+
secrets: list[SecretRef] = Field(default_factory=list)
|
|
218
217
|
|
|
219
218
|
|
|
220
219
|
params: dict[str, InferParam] | None = Field(default=None, max_length=32)
|
|
@@ -236,8 +235,8 @@ class DeploymentPolicy(BaseModel):
|
|
|
236
235
|
@model_validator(mode="after")
|
|
237
236
|
def _planner_answers_no_act(self) -> "DeploymentPolicy":
|
|
238
237
|
if self.planner is not None:
|
|
239
|
-
said = [name for name in ("hz", "action_chunk_valid_len", "action_chunk_replan_at", "
|
|
240
|
-
|
|
238
|
+
said = [name for name in ("hz", "action_chunk_valid_len", "action_chunk_replan_at", "max_wait_for_batch",
|
|
239
|
+
"tensors") if getattr(self, name) is not None]
|
|
241
240
|
if said:
|
|
242
241
|
raise ValueError(f"a planner answers no act, so it declares no {', '.join(said)}")
|
|
243
242
|
if self.plan_every_s is None:
|
|
@@ -332,12 +331,6 @@ class DeploymentRequest(BaseModel):
|
|
|
332
331
|
weights_name: str | None = None
|
|
333
332
|
extra_weights: dict[str, VolumeMount] | None = None
|
|
334
333
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
freeze: bool | None = None
|
|
340
|
-
|
|
341
334
|
@field_validator("name")
|
|
342
335
|
@classmethod
|
|
343
336
|
def _name_is_a_slug(cls, v: str) -> str:
|
|
@@ -76,7 +76,6 @@ class EvalRequest(BaseModel):
|
|
|
76
76
|
|
|
77
77
|
|
|
78
78
|
policy_machines: int | None = Field(default=None, ge=1, le=64)
|
|
79
|
-
policy_gpu: str | None = Field(default=None, max_length=32)
|
|
80
79
|
benchmark_machines: int | None = Field(default=None, ge=1, le=64)
|
|
81
80
|
adapter: str | None = Field(default=None, max_length=200)
|
|
82
81
|
|
|
@@ -284,9 +284,12 @@ class Concurrency(BaseModel):
|
|
|
284
284
|
|
|
285
285
|
`sizes` (contract 0.5.31) - from `@seq.concurrent(sizes=[1, 2, 4, 8])` on the policy's infer method - are the batch
|
|
286
286
|
sizes its infer is called with, ascending, the largest the most acts one forward takes (None: one robot a copy,
|
|
287
|
-
each act alone): the sizes its code is built for, which only its author knows - each
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
each act alone): the sizes its code is built for, which only its author knows - each timed on its sample episode by
|
|
288
|
+
its version's build check, whose timing its workers on that card seat by (one on another card times them beside its
|
|
289
|
+
first robots, a robot a copy until then)
|
|
290
|
+
, and a
|
|
291
|
+
batch of some other number of acts split into them - 1 always among them, a lone robot's act being a batch of one.
|
|
292
|
+
A copy seats as many robots
|
|
290
293
|
as the largest size whose batch answers their control loops in time, and its worker holds an early act a little so
|
|
291
294
|
robots fall into one batch.
|
|
292
295
|
The SDK takes `gpus_per_replica` and `replica_start` in
|
|
@@ -321,12 +324,6 @@ class Concurrency(BaseModel):
|
|
|
321
324
|
|
|
322
325
|
|
|
323
326
|
|
|
324
|
-
KIND_NAME = r"^[a-z0-9][a-z0-9._-]{0,31}$"
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
327
|
|
|
331
328
|
Episodes = Literal["shared", "own"]
|
|
332
329
|
|
|
@@ -370,13 +367,16 @@ class PolicySpec(BaseModel):
|
|
|
370
367
|
|
|
371
368
|
|
|
372
369
|
|
|
373
|
-
weights_name: str | None = None
|
|
374
|
-
extra_weights: dict[str, str] | None = None
|
|
375
370
|
|
|
376
371
|
|
|
377
|
-
io: str | None = Field(default=None, max_length=4000)
|
|
378
372
|
|
|
379
|
-
|
|
373
|
+
|
|
374
|
+
max_wait_for_batch: float | None = Field(default=None, gt=0, le=60)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
weights_name: str | None = None
|
|
379
|
+
extra_weights: dict[str, str] | None = None
|
|
380
380
|
|
|
381
381
|
|
|
382
382
|
tensors: Tensors | None = None
|
|
@@ -409,8 +409,8 @@ class PolicySpec(BaseModel):
|
|
|
409
409
|
|
|
410
410
|
|
|
411
411
|
if self.planner is not None:
|
|
412
|
-
said = [name for name in ("hz", "action_chunk_valid_len", "action_chunk_replan_at", "
|
|
413
|
-
|
|
412
|
+
said = [name for name in ("hz", "action_chunk_valid_len", "action_chunk_replan_at", "max_wait_for_batch",
|
|
413
|
+
"tensors") if getattr(self, name) is not None]
|
|
414
414
|
said += [f"concurrency.{name}" for name in ("sizes",)
|
|
415
415
|
if self.concurrency is not None and getattr(self.concurrency, name) is not None]
|
|
416
416
|
if said:
|
|
@@ -511,7 +511,8 @@ class PolicyRegistration(BaseModel):
|
|
|
511
511
|
|
|
512
512
|
A class that names its own methods (`constructor` set) is built by its constructor or factory, so it binds no LOAD,
|
|
513
513
|
and its bindings name its own methods: INFER (what answers an act), and as declared OBSERVE (each observation an
|
|
514
|
-
act carries, before INFER is called with none)
|
|
514
|
+
act carries, before INFER is called with none) and ON_EPISODE (as an episode begins and as it ends, its
|
|
515
|
+
episode.phase "start" or "end"); a policy binds no RESET, a benchmark's alone (by_name.RESET_GONE).
|
|
515
516
|
|
|
516
517
|
Any policy may bind SAMPLE (contract 0.5.24, `@seq.policy(sample="<method>")`): the method returning one episode's
|
|
517
518
|
calls in order, as a robot makes them - ("observe", x) for its observe(x) and ("act",) for its act(), which carries
|
|
@@ -98,15 +98,39 @@ SETTINGS: tuple[Setting, ...] = (
|
|
|
98
98
|
code="buffer_workers",
|
|
99
99
|
default=0),
|
|
100
100
|
_s("schedule.hours", "str", "gateway", "scaling", "Days and hours it keeps schedule.min_workers running, as "
|
|
101
|
-
"'Mon-Fri 08:00-18:00'
|
|
102
|
-
|
|
101
|
+
"'Mon-Fri 08:00-18:00': they start before the hours by the time its workers take to come up, so they serve as "
|
|
102
|
+
"the hours open.", max_length=80),
|
|
103
|
+
_s("schedule.min_workers", "int", "gateway", "scaling", "Workers kept running in schedule.hours, and billed from "
|
|
104
|
+
"their start before them.",
|
|
103
105
|
minimum=0, maximum=MAX_WARM_WORKERS, unit="workers"),
|
|
104
106
|
_s("schedule.tz", "str", "gateway", "scaling", "The time zone of schedule.hours, as 'America/Los_Angeles'.",
|
|
105
107
|
max_length=64, default="UTC"),
|
|
106
108
|
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
_s("region", "str", "gateway", "scaling", "Where its workers run: auto - each robot's in the region nearest it - "
|
|
112
|
+
"or one of the platform's regions, every worker there alone.", max_length=32, code="region", default="auto"),
|
|
113
|
+
|
|
107
114
|
_s(PARAMS_PREFIX + "*", "param", "episodes", "inference", "An inference parameter, by its name: what every robot "
|
|
108
115
|
"runs with, each episode from its start."),
|
|
109
116
|
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
_s("action_chunk_valid_len", "int", "episodes", "inference", "The steps of an answer that are valid: those a robot "
|
|
121
|
+
"plays of it.", minimum=1, maximum=100_000, unit="steps", code="action_chunk_valid_len"),
|
|
122
|
+
_s("action_chunk_replan_at", "int", "episodes", "inference", "The step, counted from when its act is sent, at which "
|
|
123
|
+
"the next answer is asked for: at most action_chunk_valid_len.", minimum=1, maximum=100_000, unit="steps",
|
|
124
|
+
code="action_chunk_replan_at"),
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
_s("max_wait_for_batch", "float", "episodes", "inference", "How long a robot waits for an answer, from when its "
|
|
130
|
+
"act is sent, so that its act can share a batch with other robots': more robots a worker, each waiting up to "
|
|
131
|
+
"this long. Unset, robots are seated by the steps left of the answer each plays when it asks.", above=0,
|
|
132
|
+
maximum=60, unit="s", code="max_wait_for_batch"),
|
|
133
|
+
|
|
110
134
|
_s("capture", "str", "workers", "data", "Keep every episode its robots run, whole, for export.",
|
|
111
135
|
choices=_SWITCH, default="off"),
|
|
112
136
|
_s("capture.retention_days", "int", "workers", "data", "How long kept episodes stay.",
|
|
@@ -119,9 +143,6 @@ SETTINGS: tuple[Setting, ...] = (
|
|
|
119
143
|
above=0, maximum=1),
|
|
120
144
|
_s("alerts.p95_ms", "float", "gateway", "spend", "Alert when an hour's p95 act latency is above this.",
|
|
121
145
|
above=0, maximum=600_000, unit="ms"),
|
|
122
|
-
_s("alerts.budget_pct", "int", "gateway", "spend", "Alert at this percent of the monthly budget.",
|
|
123
|
-
minimum=1, maximum=100, unit="%"),
|
|
124
|
-
_s("alerts.deploy_failed", "bool", "gateway", "spend", "Alert when a version fails to build.", default=True),
|
|
125
146
|
|
|
126
147
|
_s("timeouts.request", "int", "workers", "timeouts", "How long one inference may take before the robot is answered "
|
|
127
148
|
"that it timed out.", minimum=1, maximum=3600, unit="s", code="seq.Timeouts(request=)"),
|
|
@@ -151,14 +172,9 @@ SETTINGS: tuple[Setting, ...] = (
|
|
|
151
172
|
|
|
152
173
|
_s("models", "list", "gateway", "about", "The platform models its robots' key may call.", maximum=16,
|
|
153
174
|
max_length=200, code="models"),
|
|
154
|
-
_s("io", "str", "gateway", "about", "Its own description of what it takes and returns, handed to each robot.",
|
|
155
|
-
max_length=4000, code="io"),
|
|
156
|
-
_s("family", "str", "gateway", "about", "Its model family, which picks its icon: pi, gr00t, lerobot.",
|
|
157
|
-
max_length=32, code="family"),
|
|
158
175
|
)
|
|
159
176
|
|
|
160
177
|
_BY_KEY = {s.key: s for s in SETTINGS}
|
|
161
|
-
_FAMILY = re.compile(r"[a-z0-9][a-z0-9._-]{0,31}")
|
|
162
178
|
|
|
163
179
|
|
|
164
180
|
def setting(key: str) -> Setting | None:
|
|
@@ -205,10 +221,6 @@ def check(key: str, value: SettingValue) -> SettingValue:
|
|
|
205
221
|
if value is None or s.kind == "param":
|
|
206
222
|
return value
|
|
207
223
|
bad = ValueError(f"{key} takes {_allowed(s)}; got {value!r}")
|
|
208
|
-
if s.kind == "bool":
|
|
209
|
-
if not isinstance(value, bool):
|
|
210
|
-
raise bad
|
|
211
|
-
return value
|
|
212
224
|
if s.kind in ("int", "float"):
|
|
213
225
|
if isinstance(value, bool) or not isinstance(value, (int, float)) or not math.isfinite(value):
|
|
214
226
|
raise bad
|
|
@@ -234,17 +246,12 @@ def check(key: str, value: SettingValue) -> SettingValue:
|
|
|
234
246
|
raise bad
|
|
235
247
|
if s.choices is not None and value not in s.choices:
|
|
236
248
|
raise bad
|
|
237
|
-
if key == "family" and not _FAMILY.fullmatch(value):
|
|
238
|
-
raise ValueError(f"family is a short lowercase name, as pi or gr00t; got {value!r}")
|
|
239
249
|
return value
|
|
240
250
|
|
|
241
251
|
|
|
242
|
-
_TRUE, _FALSE = ("true", "yes", "1"), ("false", "no", "0")
|
|
243
|
-
|
|
244
|
-
|
|
245
252
|
def parse(key: str, text: str) -> SettingValue:
|
|
246
253
|
"""A command line's `key=value` as the key holds it: an empty value is None (back to the code's, else the
|
|
247
|
-
platform's); a number,
|
|
254
|
+
platform's); a number, a list as names separated by commas; then `check`. An inference parameter's
|
|
248
255
|
value is a number, true or false when it reads as one, else its text - the platform casts it to its declared type."""
|
|
249
256
|
s = setting(key)
|
|
250
257
|
if s is None:
|
|
@@ -262,10 +269,6 @@ def parse(key: str, text: str) -> SettingValue:
|
|
|
262
269
|
except ValueError:
|
|
263
270
|
pass
|
|
264
271
|
return text
|
|
265
|
-
if s.kind == "bool":
|
|
266
|
-
if text.lower() not in _TRUE + _FALSE:
|
|
267
|
-
raise ValueError(f"{key} takes true or false; got {text!r}")
|
|
268
|
-
return check(key, text.lower() in _TRUE)
|
|
269
272
|
if s.kind in ("int", "float"):
|
|
270
273
|
try:
|
|
271
274
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""
|
|
2
|
+
What a policy that keeps its episodes' state on the platform is handed (PolicySpec.episodes "shared"): its infer
|
|
3
|
+
declares `episode` and gets that episode's Episode - its id, how many of its acts were answered, and `state`, a dict of
|
|
4
|
+
the policy's own.
|
|
5
|
+
|
|
6
|
+
In one sentence: an episode's first act → the copy it is placed on makes its Episode (its id, steps 0, state and local
|
|
7
|
+
empty) and runs @seq.on_episode with its phase "start" → every act of it hands infer that same object, one more step
|
|
8
|
+
after each answer → at the episode's end @seq.on_episode runs with its phase "end", and the copy drops it.
|
|
9
|
+
|
|
10
|
+
WHY a class of the platform's rather than a dict: the id and the step count come with it, and what the policy keeps has
|
|
11
|
+
a place of its own - `state` - that no field the platform adds later can collide with.
|
|
12
|
+
|
|
13
|
+
WHY nothing in it is serialized: it lives in the process of the copy serving its episode and is handed by reference,
|
|
14
|
+
so anything goes in `state` - tensors, a model's cache - and an act costs no more for it.
|
|
15
|
+
WHY `state` and `local`, two dicts of the episode's own: what is in `state` is saved off any act's path - for the
|
|
16
|
+
standby a robot switches to (every 2 s), and with capture - so it should be small, and an episode's is kept to
|
|
17
|
+
constants.serving.MAX_EPISODE_STATE_BYTES; what is in `local` is never saved nor sent anywhere - a frame history, a
|
|
18
|
+
GPU cache, what only this copy can use - so a standby that takes the episode on starts it empty. Each episode its
|
|
19
|
+
own: a copy that batches several episodes hands each its own two, and saves and reads back each by its id alone.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
WHY `phase`: one @seq.on_episode runs as an episode begins ("start") and as it ends ("end"), which @seq.reset
|
|
23
|
+
did before it went - the hook reads which it is from its episode. {the user 11-02: "why could we jsut merge reset
|
|
24
|
+
and on epsiode", "on epside should be a superset right"}
|
|
25
|
+
"""
|
|
26
|
+
from __future__ import annotations
|
|
27
|
+
|
|
28
|
+
from typing import Any
|
|
29
|
+
|
|
30
|
+
__all__ = ["Episode", "answered", "at"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Episode:
|
|
34
|
+
"""One episode, as its policy's functions see it: `id` - the episode's id; `steps` - how many acts of it were
|
|
35
|
+
answered before this one (0 on its first; an act, however many control steps its answer is played as); `phase` -
|
|
36
|
+
"start" while @seq.on_episode runs as it begins, "end" while it runs as it ends, None in an act; `state` - a dict
|
|
37
|
+
for the policy's own that is saved (for a standby, and with capture), empty on the first act and the same object
|
|
38
|
+
on every act after; `local` - a dict for the policy's own that is never saved or sent. `id`, `steps` and `phase`
|
|
39
|
+
are the platform's: they are read, never set."""
|
|
40
|
+
|
|
41
|
+
__slots__ = ("_id", "_steps", "_phase", "state", "local")
|
|
42
|
+
|
|
43
|
+
def __init__(self, id: str) -> None:
|
|
44
|
+
object.__setattr__(self, "_id", id)
|
|
45
|
+
object.__setattr__(self, "_steps", 0)
|
|
46
|
+
object.__setattr__(self, "_phase", None)
|
|
47
|
+
object.__setattr__(self, "state", {})
|
|
48
|
+
object.__setattr__(self, "local", {})
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def id(self) -> str:
|
|
52
|
+
return self._id
|
|
53
|
+
|
|
54
|
+
@property
|
|
55
|
+
def steps(self) -> int:
|
|
56
|
+
return self._steps
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def phase(self) -> str | None:
|
|
60
|
+
return self._phase
|
|
61
|
+
|
|
62
|
+
def __setattr__(self, name: str, value: Any) -> None:
|
|
63
|
+
if name in ("state", "local"):
|
|
64
|
+
object.__setattr__(self, name, value)
|
|
65
|
+
elif name in ("id", "steps", "phase"):
|
|
66
|
+
raise AttributeError(f"Episode.{name} is the platform's: read it, never set it")
|
|
67
|
+
else:
|
|
68
|
+
raise AttributeError(f"an Episode keeps what a policy puts in it in its state, a dict: "
|
|
69
|
+
f"episode.state[{name!r}] = ... (or episode.local, never saved)")
|
|
70
|
+
|
|
71
|
+
def __repr__(self) -> str:
|
|
72
|
+
return f"Episode(id={self._id!r}, steps={self._steps})"
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def at(episode: Episode, phase: str | None) -> None:
|
|
76
|
+
"""The episode's phase as its @seq.on_episode runs - "start" as it begins, "end" as it ends - None in its acts:
|
|
77
|
+
the platform's."""
|
|
78
|
+
if phase not in (None, "start", "end"):
|
|
79
|
+
raise ValueError(f"an episode's phase is 'start', 'end' or None, never {phase!r}")
|
|
80
|
+
object.__setattr__(episode, "_phase", phase)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def answered(episode: Episode) -> None:
|
|
84
|
+
"""One more act of the episode answered - the platform's, once its infer returned."""
|
|
85
|
+
object.__setattr__(episode, "_steps", episode._steps + 1)
|
|
@@ -12,7 +12,7 @@ working. A policy uses it by annotating `infer(self, obs: Observation, ...) -> A
|
|
|
12
12
|
from __future__ import annotations
|
|
13
13
|
|
|
14
14
|
from enum import Enum
|
|
15
|
-
from typing import
|
|
15
|
+
from typing import Literal
|
|
16
16
|
|
|
17
17
|
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
|
|
18
18
|
|
|
@@ -186,39 +186,6 @@ class Camera(BaseModel):
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
def frame_size_problem(view: str, index: int, got: tuple[int, int] | None, camera: dict[str, Any]) -> str | None:
|
|
193
|
-
"""What is wrong with frame `index` of camera `view` (counted in the order the request carries that view's frames,
|
|
194
|
-
from 0), read as `got` (width, height; None: not a JPEG or PNG image), against the camera the contract declares;
|
|
195
|
-
None when it fits."""
|
|
196
|
-
if got is None:
|
|
197
|
-
return f"camera {view!r} frame {index} is not a JPEG or PNG image"
|
|
198
|
-
want = (int(camera["width"]), int(camera["height"]))
|
|
199
|
-
if tuple(got) == want:
|
|
200
|
-
return None
|
|
201
|
-
return f"camera {view!r} frame {index} is {got[0]}x{got[1]}; the policy reads {want[0]}x{want[1]}"
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
def fit_hint(view: str, camera: dict[str, Any], *, more: bool = False) -> str:
|
|
205
|
-
"""The next step for a frame of camera `view` that does not fit: the SDK call that fits it as the contract says
|
|
206
|
-
the policy was trained, or, when the contract does not say, the call with the two choices left to the caller -
|
|
207
|
-
never a guess. `more`: other views did not fit either (details.sizes lists them)."""
|
|
208
|
-
width, height = int(camera["width"]), int(camera["height"])
|
|
209
|
-
mode, flt = camera.get("resize"), camera.get("filter")
|
|
210
|
-
if mode and flt:
|
|
211
|
-
hint = (f'fit each frame on the robot before sending: '
|
|
212
|
-
f'sequence_ai.resize_image(frame, {width}, {height}, mode="{mode}", filter="{flt}")')
|
|
213
|
-
else:
|
|
214
|
-
hint = (f"fit each frame on the robot before sending: sequence_ai.resize_image(frame, {width}, {height}, "
|
|
215
|
-
f"mode=..., filter=...) with the mode and filter the policy was trained with; this deployment does "
|
|
216
|
-
f"not declare them")
|
|
217
|
-
return hint + (" (the same for each view in details.sizes)" if more else "")
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
189
|
PAYLOAD_HINT = ("fit each camera frame on the robot before sending (sequence_ai.resize_image): a frame at the size a "
|
|
223
190
|
"policy reads is a few kB")
|
|
224
191
|
|