Upload modality_human_hand.py with huggingface_hub
Browse files- modality_human_hand.py +42 -0
modality_human_hand.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from gr00t.configs.data.embodiment_configs import register_modality_config
|
| 2 |
+
from gr00t.data.embodiment_tags import EmbodimentTag
|
| 3 |
+
from gr00t.data.types import (
|
| 4 |
+
ActionConfig,
|
| 5 |
+
ActionFormat,
|
| 6 |
+
ActionRepresentation,
|
| 7 |
+
ActionType,
|
| 8 |
+
ModalityConfig,
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
human_hand_config = {
|
| 12 |
+
"video": ModalityConfig(
|
| 13 |
+
delta_indices=[0],
|
| 14 |
+
modality_keys=["top"],
|
| 15 |
+
),
|
| 16 |
+
"state": ModalityConfig(
|
| 17 |
+
delta_indices=[0],
|
| 18 |
+
modality_keys=["gripper"], # single_arm removed — MediaPipe coords don't map to robot EEF
|
| 19 |
+
),
|
| 20 |
+
"action": ModalityConfig(
|
| 21 |
+
delta_indices=list(range(0, 16)),
|
| 22 |
+
modality_keys=["single_arm", "gripper"],
|
| 23 |
+
action_configs=[
|
| 24 |
+
ActionConfig(
|
| 25 |
+
rep=ActionRepresentation.ABSOLUTE,
|
| 26 |
+
type=ActionType.NON_EEF,
|
| 27 |
+
format=ActionFormat.DEFAULT,
|
| 28 |
+
),
|
| 29 |
+
ActionConfig(
|
| 30 |
+
rep=ActionRepresentation.ABSOLUTE,
|
| 31 |
+
type=ActionType.NON_EEF,
|
| 32 |
+
format=ActionFormat.DEFAULT,
|
| 33 |
+
),
|
| 34 |
+
],
|
| 35 |
+
),
|
| 36 |
+
"language": ModalityConfig(
|
| 37 |
+
delta_indices=[0],
|
| 38 |
+
modality_keys=["annotation.human.task_description"],
|
| 39 |
+
),
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
register_modality_config(human_hand_config, embodiment_tag=EmbodimentTag.NEW_EMBODIMENT)
|