robocandywrapper 0.2.9__tar.gz → 0.2.11__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.9/robocandywrapper.egg-info → robocandywrapper-0.2.11}/PKG-INFO +1 -1
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/pyproject.toml +1 -1
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/__init__.py +1 -1
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/metadata_view.py +19 -5
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/wrapper.py +8 -3
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11/robocandywrapper.egg-info}/PKG-INFO +1 -1
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/setup.py +1 -1
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/LICENSE +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/MANIFEST.in +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/README.md +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/constants.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/__init__.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/__init__.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/convert_v20_to_v21.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/dataset.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/utils.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/factory.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugin.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/__init__.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/affordance.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/control_mode.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/episode_outcome.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/plugins/subtask.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/__init__.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/config.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/factory.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/samplers/weighted.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/utils.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/SOURCES.txt +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/dependency_links.txt +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/requires.txt +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/top_level.txt +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/setup.cfg +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/tests/test_dataset_weights_integration.py +0 -0
- {robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/tests/test_key_rename_stats.py +0 -0
|
@@ -79,11 +79,25 @@ def aggregate_stats_weighted(
|
|
|
79
79
|
if not stats_with_key:
|
|
80
80
|
continue
|
|
81
81
|
|
|
82
|
-
# Extract arrays
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
# Extract arrays, padding to max dim if shapes differ
|
|
83
|
+
def _to_arrays(stat_key, pad_value=0.0):
|
|
84
|
+
arrs = [np.array(s[stat_key]) for s in stats_with_key]
|
|
85
|
+
if any(a.shape != arrs[0].shape for a in arrs):
|
|
86
|
+
max_dim = max(a.shape[-1] for a in arrs if a.ndim > 0)
|
|
87
|
+
padded = []
|
|
88
|
+
for a in arrs:
|
|
89
|
+
if a.ndim > 0 and a.shape[-1] < max_dim:
|
|
90
|
+
pad_width = [(0, 0)] * (a.ndim - 1) + [(0, max_dim - a.shape[-1])]
|
|
91
|
+
padded.append(np.pad(a, pad_width, constant_values=pad_value))
|
|
92
|
+
else:
|
|
93
|
+
padded.append(a)
|
|
94
|
+
return np.stack(padded)
|
|
95
|
+
return np.stack(arrs)
|
|
96
|
+
|
|
97
|
+
means = _to_arrays("mean", pad_value=0.0)
|
|
98
|
+
stds = _to_arrays("std", pad_value=1.0)
|
|
99
|
+
mins = _to_arrays("min", pad_value=0.0)
|
|
100
|
+
maxs = _to_arrays("max", pad_value=0.0)
|
|
87
101
|
|
|
88
102
|
# Get counts and apply weight multipliers
|
|
89
103
|
# Extract scalar count value (handle both scalar and array counts)
|
|
@@ -642,11 +642,16 @@ class WrappedRobotDataset(torch.utils.data.Dataset):
|
|
|
642
642
|
|
|
643
643
|
# Fill missing image keys with zeros/noise
|
|
644
644
|
if self._filled_image_keys:
|
|
645
|
-
# Find a reference image shape from an existing image key
|
|
645
|
+
# Find a reference image shape from an existing image key
|
|
646
646
|
ref_shape = None
|
|
647
647
|
for k, v in item.items():
|
|
648
|
-
if hasattr(v, 'shape')
|
|
649
|
-
|
|
648
|
+
if not hasattr(v, 'shape'):
|
|
649
|
+
continue
|
|
650
|
+
s = v.shape
|
|
651
|
+
# Match image tensors: 3+ dims, last dim is 3 (RGB) or 4 (RGBA),
|
|
652
|
+
# and spatial dims are reasonable (> 16 pixels)
|
|
653
|
+
if len(s) >= 3 and s[-1] in (3, 4) and s[-3] > 16 and s[-2] > 16:
|
|
654
|
+
ref_shape = s
|
|
650
655
|
ref_dtype = v.dtype if hasattr(v, 'dtype') else torch.uint8
|
|
651
656
|
break
|
|
652
657
|
for key in self._filled_image_keys:
|
|
@@ -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.11",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper/dataformats/lerobot_21/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/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
|
{robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/robocandywrapper.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robocandywrapper-0.2.9 → robocandywrapper-0.2.11}/tests/test_dataset_weights_integration.py
RENAMED
|
File without changes
|
|
File without changes
|