robocandywrapper 0.2.15__tar.gz → 0.2.17__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.
- {robocandywrapper-0.2.15/robocandywrapper.egg-info → robocandywrapper-0.2.17}/PKG-INFO +1 -5
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/pyproject.toml +1 -11
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/__init__.py +1 -1
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/lerobot_21/convert_v20_to_v21.py +1 -1
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/lerobot_21/dataset.py +21 -11
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/factory.py +3 -3
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/control_mode.py +3 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/wrapper.py +1 -1
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17/robocandywrapper.egg-info}/PKG-INFO +1 -5
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper.egg-info/requires.txt +0 -4
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/setup.py +1 -1
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/LICENSE +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/MANIFEST.in +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/README.md +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/constants.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/__init__.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/lerobot_21/__init__.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/lerobot_21/utils.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/metadata_view.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugin.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/__init__.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/affordance.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/episode_outcome.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/molmopoint.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/subtask.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/samplers/__init__.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/samplers/config.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/samplers/factory.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/samplers/weighted.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/utils.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper.egg-info/SOURCES.txt +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper.egg-info/dependency_links.txt +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper.egg-info/top_level.txt +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/setup.cfg +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/tests/test_dataset_weights_integration.py +0 -0
- {robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/tests/test_key_rename_stats.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: robocandywrapper
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.17
|
|
4
4
|
Summary: Sweet wrappers for extending and remixing LeRobot Datasets
|
|
5
5
|
Author: RoboCandyWrapper Contributors
|
|
6
6
|
License: MIT License
|
|
@@ -42,10 +42,6 @@ Requires-Dist: numpy>=1.20.0
|
|
|
42
42
|
Requires-Dist: torch>=2.0.0
|
|
43
43
|
Requires-Dist: lerobot<0.5,>=0.4
|
|
44
44
|
Requires-Dist: pandas>=1.3.0
|
|
45
|
-
Requires-Dist: rewact_tools
|
|
46
|
-
Requires-Dist: motion-primitives
|
|
47
|
-
Requires-Dist: lerobot-policy-diffusion-motion-primitives
|
|
48
|
-
Requires-Dist: lerobot-policy-diffusion-pointing
|
|
49
45
|
Provides-Extra: dev
|
|
50
46
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
51
47
|
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "robocandywrapper"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.17"
|
|
8
8
|
description = "Sweet wrappers for extending and remixing LeRobot Datasets"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10,<3.11"
|
|
@@ -27,10 +27,6 @@ dependencies = [
|
|
|
27
27
|
"torch>=2.0.0",
|
|
28
28
|
"lerobot>=0.4,<0.5",
|
|
29
29
|
"pandas>=1.3.0",
|
|
30
|
-
"rewact_tools",
|
|
31
|
-
"motion-primitives",
|
|
32
|
-
"lerobot-policy-diffusion-motion-primitives",
|
|
33
|
-
"lerobot-policy-diffusion-pointing",
|
|
34
30
|
]
|
|
35
31
|
|
|
36
32
|
[project.optional-dependencies]
|
|
@@ -56,12 +52,6 @@ override-dependencies = [
|
|
|
56
52
|
"evdev>=0.0.0; sys_platform == 'never'",
|
|
57
53
|
]
|
|
58
54
|
|
|
59
|
-
[tool.uv.sources]
|
|
60
|
-
lerobot-policy-diffusion-motion-primitives = { path = "../../experimental/lerobot_policy_diffusion_motion_primitives", editable = true }
|
|
61
|
-
lerobot-policy-diffusion-pointing = { path = "../../experimental/lerobot_policy_diffusion_pointing", editable = true }
|
|
62
|
-
motion-primitives = { path = "../../experimental/motion_primitives", editable = true }
|
|
63
|
-
rewact-tools = { path = "../rewACT/rewact_tools", editable = true }
|
|
64
|
-
|
|
65
55
|
[tool.black]
|
|
66
56
|
line-length = 100
|
|
67
57
|
target-version = ['py310']
|
|
@@ -34,7 +34,7 @@ from huggingface_hub import HfApi
|
|
|
34
34
|
from tqdm import tqdm
|
|
35
35
|
|
|
36
36
|
from lerobot.datasets.compute_stats import aggregate_stats, get_feature_stats, sample_indices
|
|
37
|
-
from lerobot.datasets.
|
|
37
|
+
from lerobot.datasets.io_utils import load_stats, write_info
|
|
38
38
|
|
|
39
39
|
from robocandywrapper.dataformats.lerobot_21.dataset import LeRobot21Dataset
|
|
40
40
|
from robocandywrapper.dataformats.lerobot_21.utils import (
|
|
@@ -38,24 +38,34 @@ from lerobot.datasets.utils import (
|
|
|
38
38
|
DEFAULT_IMAGE_PATH,
|
|
39
39
|
INFO_PATH,
|
|
40
40
|
LEGACY_TASKS_PATH as TASKS_PATH,
|
|
41
|
+
check_version_compatibility,
|
|
42
|
+
create_lerobot_dataset_card,
|
|
43
|
+
get_safe_version,
|
|
44
|
+
is_valid_version,
|
|
45
|
+
)
|
|
46
|
+
from lerobot.datasets.feature_utils import (
|
|
41
47
|
_validate_feature_names,
|
|
42
48
|
check_delta_timestamps,
|
|
43
|
-
check_version_compatibility,
|
|
44
49
|
create_empty_dataset_info,
|
|
45
|
-
create_lerobot_dataset_card,
|
|
46
|
-
embed_images,
|
|
47
50
|
get_delta_indices,
|
|
48
51
|
get_hf_features_from_features,
|
|
49
|
-
get_safe_version,
|
|
50
|
-
hf_transform_to_torch,
|
|
51
|
-
is_valid_version,
|
|
52
|
-
load_info,
|
|
53
|
-
load_stats,
|
|
54
52
|
validate_episode_buffer,
|
|
55
53
|
validate_frame,
|
|
54
|
+
)
|
|
55
|
+
from lerobot.datasets.io_utils import (
|
|
56
|
+
embed_images,
|
|
57
|
+
load_info,
|
|
58
|
+
load_stats,
|
|
56
59
|
write_info,
|
|
57
60
|
write_json,
|
|
58
61
|
)
|
|
62
|
+
|
|
63
|
+
def hf_transform_to_torch(item):
|
|
64
|
+
"""Compat shim: transforms HF dataset items to torch tensors."""
|
|
65
|
+
for key in item:
|
|
66
|
+
if isinstance(item[key], np.ndarray):
|
|
67
|
+
item[key] = torch.from_numpy(item[key])
|
|
68
|
+
return item
|
|
59
69
|
# Import legacy v2.1-specific functions that were removed in lerobot 0.4.1
|
|
60
70
|
from robocandywrapper.dataformats.lerobot_21.utils import (
|
|
61
71
|
append_jsonlines,
|
|
@@ -749,7 +759,7 @@ class LeRobot21Dataset(torch.utils.data.Dataset):
|
|
|
749
759
|
|
|
750
760
|
def __getitem__(self, idx) -> dict:
|
|
751
761
|
item = self.hf_dataset[idx]
|
|
752
|
-
ep_idx = item["episode_index"].item()
|
|
762
|
+
ep_idx = item["episode_index"].item() if isinstance(item["episode_index"], torch.Tensor) else item["episode_index"]
|
|
753
763
|
|
|
754
764
|
query_indices = None
|
|
755
765
|
if self.delta_indices is not None:
|
|
@@ -760,7 +770,7 @@ class LeRobot21Dataset(torch.utils.data.Dataset):
|
|
|
760
770
|
item[key] = val
|
|
761
771
|
|
|
762
772
|
if len(self.meta.video_keys) > 0:
|
|
763
|
-
current_ts = item["timestamp"].item()
|
|
773
|
+
current_ts = item["timestamp"].item() if isinstance(item["timestamp"], torch.Tensor) else item["timestamp"]
|
|
764
774
|
query_timestamps = self._get_query_timestamps(current_ts, query_indices)
|
|
765
775
|
video_frames = self._query_videos(query_timestamps, ep_idx)
|
|
766
776
|
item = {**video_frames, **item}
|
|
@@ -771,7 +781,7 @@ class LeRobot21Dataset(torch.utils.data.Dataset):
|
|
|
771
781
|
item[cam] = self.image_transforms(item[cam])
|
|
772
782
|
|
|
773
783
|
# Add task as a string
|
|
774
|
-
task_idx = item["task_index"].item()
|
|
784
|
+
task_idx = item["task_index"].item() if isinstance(item["task_index"], torch.Tensor) else item["task_index"]
|
|
775
785
|
item["task"] = self.meta.tasks[task_idx]
|
|
776
786
|
|
|
777
787
|
# Hack - add gripper position to end
|
|
@@ -10,7 +10,7 @@ from lerobot.datasets.lerobot_dataset import (
|
|
|
10
10
|
LeRobotDataset,
|
|
11
11
|
LeRobotDatasetMetadata,
|
|
12
12
|
)
|
|
13
|
-
from lerobot.datasets.
|
|
13
|
+
from lerobot.datasets.utils import BackwardCompatibilityError
|
|
14
14
|
from lerobot.datasets.transforms import ImageTransforms
|
|
15
15
|
from lerobot.datasets.factory import IMAGENET_STATS
|
|
16
16
|
from lerobot.utils.constants import ACTION, REWARD
|
|
@@ -71,7 +71,7 @@ def _create_datasets(
|
|
|
71
71
|
root: Optional[str],
|
|
72
72
|
revision: Optional[str],
|
|
73
73
|
episodes: Optional[list[int] | dict[str, list[int]]],
|
|
74
|
-
video_backend: str,
|
|
74
|
+
video_backend: str | None,
|
|
75
75
|
action_delta_indices: Optional[List] = None,
|
|
76
76
|
observation_delta_indices: Optional[List] = None,
|
|
77
77
|
reward_delta_indices: Optional[List] = None,
|
|
@@ -250,7 +250,7 @@ def make_dataset_without_config(
|
|
|
250
250
|
action_delta_indices: List = None,
|
|
251
251
|
observation_delta_indices: List = None,
|
|
252
252
|
root: str = None,
|
|
253
|
-
video_backend: str =
|
|
253
|
+
video_backend: str | None = None,
|
|
254
254
|
episodes: list[int] | dict[str, list[int]] | None = None,
|
|
255
255
|
revision: str | None = None,
|
|
256
256
|
use_imagenet_stats: bool = True,
|
{robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/control_mode.py
RENAMED
|
@@ -197,9 +197,12 @@ class ControlModeInstance(PluginInstance):
|
|
|
197
197
|
"""Find the episode_modes.json file for a dataset root, or None."""
|
|
198
198
|
cw = dataset_root / CANDYWRAPPER_PLUGINS_DIR
|
|
199
199
|
legacy = cw / "dagger_data_source" / "episode_modes.json"
|
|
200
|
+
legacy_2 = dataset_root / "dagger_data_source" / "episode_modes.json"
|
|
200
201
|
current = cw / CONTROL_MODE_PLUGIN_NAME / "episode_modes.json"
|
|
201
202
|
if legacy.exists():
|
|
202
203
|
return legacy
|
|
204
|
+
if legacy_2.exists():
|
|
205
|
+
return legacy_2
|
|
203
206
|
if current.exists():
|
|
204
207
|
return current
|
|
205
208
|
return None
|
|
@@ -627,7 +627,7 @@ class WrappedRobotDataset(torch.utils.data.Dataset):
|
|
|
627
627
|
else:
|
|
628
628
|
item = dataset[local_idx]
|
|
629
629
|
|
|
630
|
-
episode_idx = item["episode_index"].item()
|
|
630
|
+
episode_idx = item["episode_index"].item() if isinstance(item["episode_index"], torch.Tensor) else item["episode_index"]
|
|
631
631
|
|
|
632
632
|
# Add dataset index
|
|
633
633
|
item["dataset_index"] = torch.tensor(dataset_idx)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: robocandywrapper
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.17
|
|
4
4
|
Summary: Sweet wrappers for extending and remixing LeRobot Datasets
|
|
5
5
|
Author: RoboCandyWrapper Contributors
|
|
6
6
|
License: MIT License
|
|
@@ -42,10 +42,6 @@ Requires-Dist: numpy>=1.20.0
|
|
|
42
42
|
Requires-Dist: torch>=2.0.0
|
|
43
43
|
Requires-Dist: lerobot<0.5,>=0.4
|
|
44
44
|
Requires-Dist: pandas>=1.3.0
|
|
45
|
-
Requires-Dist: rewact_tools
|
|
46
|
-
Requires-Dist: motion-primitives
|
|
47
|
-
Requires-Dist: lerobot-policy-diffusion-motion-primitives
|
|
48
|
-
Requires-Dist: lerobot-policy-diffusion-pointing
|
|
49
45
|
Provides-Extra: dev
|
|
50
46
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
51
47
|
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
@@ -9,7 +9,7 @@ long_description = readme_file.read_text(encoding="utf-8") if readme_file.exists
|
|
|
9
9
|
|
|
10
10
|
setup(
|
|
11
11
|
name="robocandywrapper",
|
|
12
|
-
version="0.2.
|
|
12
|
+
version="0.2.17",
|
|
13
13
|
description="Sweet wrappers for extending and remixing LeRobot Datasets",
|
|
14
14
|
long_description=long_description,
|
|
15
15
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/dataformats/lerobot_21/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper/plugins/episode_outcome.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/robocandywrapper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.15 → robocandywrapper-0.2.17}/tests/test_dataset_weights_integration.py
RENAMED
|
File without changes
|
|
File without changes
|