Add files using upload-large-folder tool
Browse files- policy/EVA/checkpoints/peg_insertion_eva/dataset_stats.pkl +3 -0
- policy/EVA/checkpoints/peg_insertion_eva/train_val_event_seed_1.png +3 -0
- policy/EVA/checkpoints/peg_insertion_eva/train_val_kl_seed_1.png +3 -0
- policy/EVA/checkpoints/peg_insertion_eva/train_val_l1_seed_1.png +3 -0
- policy/EVA/checkpoints/peg_insertion_eva/train_val_loss_seed_1.png +3 -0
- policy/EVA/data_diagnosis.png +3 -0
- policy/EVA/imitate_episodes.py +2 -4
- policy/EVA/process_data.py +6 -5
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_10.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_13.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_14.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_16.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_17.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_18.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_19.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_2.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_20.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_21.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_24.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_25.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_27.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_28.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_3.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_30.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_31.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_32.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_33.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_35.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_36.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_37.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_38.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_39.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_41.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_43.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_44.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_46.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_47.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_48.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_49.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_5.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_7.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_8.hdf5 +1 -1
- policy/EVA/processed_data/sim-peg_insertion/default-50/episode_9.hdf5 +1 -1
- tactile_tasks/eval_eva.py +221 -0
policy/EVA/checkpoints/peg_insertion_eva/dataset_stats.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:087e088d9f78907603c0acd7055ba0cbff36a89599b62604e2d222533f830d10
|
| 3 |
+
size 419
|
policy/EVA/checkpoints/peg_insertion_eva/train_val_event_seed_1.png
ADDED
|
Git LFS Details
|
policy/EVA/checkpoints/peg_insertion_eva/train_val_kl_seed_1.png
ADDED
|
Git LFS Details
|
policy/EVA/checkpoints/peg_insertion_eva/train_val_l1_seed_1.png
ADDED
|
Git LFS Details
|
policy/EVA/checkpoints/peg_insertion_eva/train_val_loss_seed_1.png
ADDED
|
Git LFS Details
|
policy/EVA/data_diagnosis.png
ADDED
|
Git LFS Details
|
policy/EVA/imitate_episodes.py
CHANGED
|
@@ -82,10 +82,8 @@ def main(args):
|
|
| 82 |
}
|
| 83 |
|
| 84 |
if is_eval:
|
| 85 |
-
|
| 86 |
-
print(f"
|
| 87 |
-
# TODO: implement eval loop for EVA
|
| 88 |
-
print("EVA eval not yet implemented — use ACT eval with tactile wrapper")
|
| 89 |
return
|
| 90 |
|
| 91 |
train_dataloader, val_dataloader, stats, _ = load_data(
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
if is_eval:
|
| 85 |
+
print("Use tactile_tasks/eval_eva.py for evaluation:")
|
| 86 |
+
print(f" python tactile_tasks/eval_eva.py --task {task_name.split('-')[1]}")
|
|
|
|
|
|
|
| 87 |
return
|
| 88 |
|
| 89 |
train_dataloader, val_dataloader, stats, _ = load_data(
|
policy/EVA/process_data.py
CHANGED
|
@@ -52,11 +52,12 @@ def process_episode(raw_path, save_path):
|
|
| 52 |
gripper_state = gripper_qpos[:, 0:1] # [T, 1]
|
| 53 |
qpos = np.concatenate([joint_pos, gripper_state], axis=1).astype(np.float32) # [T, 8]
|
| 54 |
|
| 55 |
-
# action:
|
| 56 |
-
#
|
| 57 |
-
action = np.
|
| 58 |
-
|
| 59 |
-
|
|
|
|
| 60 |
|
| 61 |
# Tactile window: for each control step t, take 5 tactile frames [t*5 : t*5+5]
|
| 62 |
T_tac = len(tl)
|
|
|
|
| 52 |
gripper_state = gripper_qpos[:, 0:1] # [T, 1]
|
| 53 |
qpos = np.concatenate([joint_pos, gripper_state], axis=1).astype(np.float32) # [T, 8]
|
| 54 |
|
| 55 |
+
# action: raw OSC_POSE delta commands [dx,dy,dz,drx,dry,drz,gripper] = 7D
|
| 56 |
+
# Pad gripper command as 8th dim to match state_dim
|
| 57 |
+
action = np.concatenate([
|
| 58 |
+
actions_raw, # [T, 7] OSC deltas
|
| 59 |
+
np.sign(actions_raw[:, -1:]), # [T, 1] gripper: +1=close, -1=open
|
| 60 |
+
], axis=1).astype(np.float32) # [T, 8]
|
| 61 |
|
| 62 |
# Tactile window: for each control step t, take 5 tactile frames [t*5 : t*5+5]
|
| 63 |
T_tac = len(tl)
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_10.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 183777864
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1bc5c2fbc54fe7923fda14db9f7d8d908aa201d989dbb116dcac780506cba782
|
| 3 |
size 183777864
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_13.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192472440
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e9e03882f9ca322db91087b95134f317714ba53240a8f50a96db8c811de5068
|
| 3 |
size 192472440
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_14.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 188915568
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f445a8cf5d1cf4388207dd1fba2c8a3343f94e0ec8756bdcecb7c86da01cce13
|
| 3 |
size 188915568
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_16.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 191682024
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59a22fea870711d0ab7afdd6d337497c7d0d73dc0187744d10fae0f5e2ad2258
|
| 3 |
size 191682024
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_17.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 188915568
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0cdfd229e36a02779ea63ad37471ca7b69ba730963bd4cc14d6f83994fb40ced
|
| 3 |
size 188915568
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_18.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192867648
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b61084cca9a69d7f7b26007de96f284f2d4498800fe832b8a36672bcce963e7a
|
| 3 |
size 192867648
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_19.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 188520360
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4f9e74b792c0d672e6162b3e0b1f7780877db8c558f15e5a6d1df8a177dd5a0
|
| 3 |
size 188520360
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_2.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 184568280
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8d2dd0fbe22566b42fd581f8d4d4bcfc887c1dffb76d42f8cab0069a8914fe4e
|
| 3 |
size 184568280
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_20.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 187334736
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd135b80e78bbafea465d1eba74984faf452a9375e1c88b0af6480dea54fcc7e
|
| 3 |
size 187334736
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_21.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 172712040
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ac89558ca116ab5ddfcf9ac20bddc6de44b128bb856c3ef53fc57c9094f510d
|
| 3 |
size 172712040
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_24.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192472440
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4fa34501f340862601797c52a86ff7853614988159a74ae27847d298e0216b40
|
| 3 |
size 192472440
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_25.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 186939528
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec1f08ea572f7df9c285272118ee35188804830e7b0bb390e7367d3409626ca1
|
| 3 |
size 186939528
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_27.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 187729944
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be79dfa70d6dc0c9844296e063c3b089eb12dd87b5d994fecc8152cfbf58443f
|
| 3 |
size 187729944
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_28.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 190891608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4c440ed8fe01a7ca7a70aeaf38f1a3f8367ee1caf1d087e3f27ca121bbb12d4
|
| 3 |
size 190891608
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_3.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192472440
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d5ad63709c3c243effe94e46462eb80b66edfa1a38203f28746d6161786bf03
|
| 3 |
size 192472440
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_30.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 190891608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89f7c3c79f7c6ab2a275a35af5753f037dbf5e8342ebb2f018c44480c07d9a3e
|
| 3 |
size 190891608
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_31.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 191682024
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6ce2e1a068fced21dd0b386cc24ce14fcd474d9c6f20a39c7d3759a255c4f7e
|
| 3 |
size 191682024
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_32.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 185358696
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15e38e6e0e5f8b4f976937f7aa7387d5da7cc7f40d2977884ee7435ef30932f0
|
| 3 |
size 185358696
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_33.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192867648
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b90ca6c6c8ffc10ad23c735d6b7c25e01edd0905cf0a142df3abe3713907b5b
|
| 3 |
size 192867648
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_35.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 185358696
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1672ad1cb3c48fdb3d195a2e7d46d5c112c131aed6cda979862ef534fc6bfb9f
|
| 3 |
size 185358696
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_36.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 186939528
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:62913548cfdc4de0d14d0fd1003d44661f892d11825bb4d8ff91fb7633d14232
|
| 3 |
size 186939528
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_37.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 191286816
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b503f04cd628136f5493d2a4715245ba0ac0c701f32691d4c5246fd268efacd1
|
| 3 |
size 191286816
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_38.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192077232
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87f22a8606b85f1946a91ca4617ed53c1f8b1ea3f1bc3800ceed99f8048df65d
|
| 3 |
size 192077232
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_39.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 188520360
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a113d0804c4ea3172ace21a51461c5b020cb4a997646645ee361ab083dfdf18e
|
| 3 |
size 188520360
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_41.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 186149112
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a0da563e8324c4a0d42f2fc035f6c1bad373467658d1548ec45bc1428650b0a
|
| 3 |
size 186149112
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_43.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192472440
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9dc77cbe4cf5c5c87ed95963a043a2f54788e1d5fd23a3651d96b054f241d639
|
| 3 |
size 192472440
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_44.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 190891608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88d80944c2cc19cf1538de1c0c6088ba402b81eab96c9abdecfa4d213e3ce97a
|
| 3 |
size 190891608
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_46.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 187729944
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6022205451523fe2f7b715423878493b11a90771545b9151cac64594b27ed9ba
|
| 3 |
size 187729944
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_47.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 192077232
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7268ca2e6db2fc49be0d5da846976d34c34aa71d476c0d6cb6757ed3ed3380a2
|
| 3 |
size 192077232
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_48.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 189310776
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5029cd9fb17a75c788d9098baa2454bc59bd71b1f086bca16bcbd231cd66129d
|
| 3 |
size 189310776
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_49.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 187729944
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9252d4ee2354197cb2f41c96409a158b32a607f473f1f19f24655bf4f5ff1c5d
|
| 3 |
size 187729944
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_5.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 195634104
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e75631326a79cad4b998ac7f02f14fa02ec5ed19ca139acec57663ba3800588
|
| 3 |
size 195634104
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_7.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 190891608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37f383e053726d76d73306509e1e1e0c3d4f4be998a1f3972394266d00eb36a5
|
| 3 |
size 190891608
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_8.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 191286816
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35f47faa4c03272e8fa12c752b3d7199f02d1c2309c1a98f54befc43296b33ee
|
| 3 |
size 191286816
|
policy/EVA/processed_data/sim-peg_insertion/default-50/episode_9.hdf5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 195634104
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c4370ba9df7ccb1d9caa7389724983f1928284804eed09c54c870c582705f12
|
| 3 |
size 195634104
|
tactile_tasks/eval_eva.py
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Evaluate trained EVA policy in robosuite environment.
|
| 4 |
+
|
| 5 |
+
Same structure as eval_act.py, but adds tactile observation.
|
| 6 |
+
|
| 7 |
+
Usage:
|
| 8 |
+
python tactile_tasks/eval_eva.py --task peg_insertion
|
| 9 |
+
python tactile_tasks/eval_eva.py --task peg_insertion --temporal_agg
|
| 10 |
+
python tactile_tasks/eval_eva.py --task peg_insertion --ckpt policy_last.ckpt
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
import os
|
| 14 |
+
import sys
|
| 15 |
+
import argparse
|
| 16 |
+
import pickle
|
| 17 |
+
|
| 18 |
+
import numpy as np
|
| 19 |
+
import torch
|
| 20 |
+
|
| 21 |
+
# Setup paths
|
| 22 |
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "policy", "EVA"))
|
| 23 |
+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "policy", "EVA", "detr"))
|
| 24 |
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 25 |
+
|
| 26 |
+
from eva_policy import EVAPolicy
|
| 27 |
+
from tactile_tasks.uskin_sensor import USkinSensor
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def load_policy(ckpt_dir, ckpt_name, policy_config):
|
| 31 |
+
"""Load trained EVA policy and dataset stats."""
|
| 32 |
+
policy = EVAPolicy(policy_config)
|
| 33 |
+
ckpt_path = os.path.join(ckpt_dir, ckpt_name)
|
| 34 |
+
loading_status = policy.load_state_dict(torch.load(ckpt_path, map_location="cpu"))
|
| 35 |
+
print(f"Loaded: {ckpt_path} ({loading_status})")
|
| 36 |
+
policy.cuda()
|
| 37 |
+
policy.eval()
|
| 38 |
+
|
| 39 |
+
stats_path = os.path.join(ckpt_dir, "dataset_stats.pkl")
|
| 40 |
+
with open(stats_path, "rb") as f:
|
| 41 |
+
stats = pickle.load(f)
|
| 42 |
+
|
| 43 |
+
return policy, stats
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def get_obs(env, camera_names, stats):
|
| 47 |
+
"""Extract qpos and images from robosuite env, apply normalization."""
|
| 48 |
+
robot = env.robots[0]
|
| 49 |
+
|
| 50 |
+
# qpos: joint_pos(7) + normalized_gripper(1) = 8D
|
| 51 |
+
joint_pos = np.array(env.sim.data.qpos[robot._ref_joint_pos_indexes])
|
| 52 |
+
gripper_idx = robot._ref_gripper_joint_pos_indexes.get("right", [])
|
| 53 |
+
gripper_val = env.sim.data.qpos[gripper_idx][0] / 0.8 if len(gripper_idx) else 0.0
|
| 54 |
+
qpos = np.concatenate([joint_pos, [gripper_val]]).astype(np.float32)
|
| 55 |
+
|
| 56 |
+
# Normalize qpos
|
| 57 |
+
qpos_norm = (qpos - stats["qpos_mean"]) / stats["qpos_std"]
|
| 58 |
+
qpos_tensor = torch.from_numpy(qpos_norm).float().cuda().unsqueeze(0)
|
| 59 |
+
|
| 60 |
+
# Images: stack cameras -> (1, num_cams, 3, H, W)
|
| 61 |
+
obs = env._get_observations()
|
| 62 |
+
cam_map = {"agentview": "agentview_image", "eye_in_hand": "robot0_eye_in_hand_image"}
|
| 63 |
+
images = []
|
| 64 |
+
for cam in camera_names:
|
| 65 |
+
key = cam_map.get(cam, cam + "_image")
|
| 66 |
+
img = obs[key] # (H, W, 3) uint8
|
| 67 |
+
img = np.transpose(img, (2, 0, 1)) # -> (3, H, W)
|
| 68 |
+
images.append(img)
|
| 69 |
+
images = np.stack(images, axis=0) # (num_cams, 3, H, W)
|
| 70 |
+
images = torch.from_numpy(images / 255.0).float().cuda().unsqueeze(0)
|
| 71 |
+
|
| 72 |
+
return qpos_tensor, images
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def get_tactile(sensor):
|
| 76 |
+
"""Read one control-step worth of tactile data: [1, 2, 5, 4, 4, 3]."""
|
| 77 |
+
left_frames = []
|
| 78 |
+
right_frames = []
|
| 79 |
+
for _ in range(USkinSensor.FREQ_MULTIPLIER):
|
| 80 |
+
sensor.update()
|
| 81 |
+
left_frames.append(sensor._left_forces.copy())
|
| 82 |
+
right_frames.append(sensor._right_forces.copy())
|
| 83 |
+
tl = np.stack(left_frames) # [5, 4, 4, 3]
|
| 84 |
+
tr = np.stack(right_frames) # [5, 4, 4, 3]
|
| 85 |
+
tactile = np.stack([tl, tr]) # [2, 5, 4, 4, 3]
|
| 86 |
+
return torch.from_numpy(tactile).float().cuda().unsqueeze(0)
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
def run_eval(task, ckpt_dir, ckpt_name, num_rollouts, temporal_agg, camera_names,
|
| 90 |
+
render=False):
|
| 91 |
+
"""Run evaluation rollouts."""
|
| 92 |
+
import yaml
|
| 93 |
+
|
| 94 |
+
# Load EVA config
|
| 95 |
+
config_path = os.path.join(os.path.dirname(__file__), "..", "policy", "EVA", "train_config.yaml")
|
| 96 |
+
with open(config_path, "r") as f:
|
| 97 |
+
cfg = yaml.safe_load(f)
|
| 98 |
+
|
| 99 |
+
state_dim = cfg["state_dim"]
|
| 100 |
+
chunk_size = cfg["chunk_size"]
|
| 101 |
+
|
| 102 |
+
policy_config = {
|
| 103 |
+
"lr": cfg["lr"],
|
| 104 |
+
"num_queries": chunk_size,
|
| 105 |
+
"kl_weight": cfg["kl_weight"],
|
| 106 |
+
"event_weight": cfg.get("event_weight", 0.1),
|
| 107 |
+
"hidden_dim": cfg["hidden_dim"],
|
| 108 |
+
"dim_feedforward": cfg["dim_feedforward"],
|
| 109 |
+
"lr_backbone": 1e-5,
|
| 110 |
+
"backbone": "resnet18",
|
| 111 |
+
"enc_layers": 4,
|
| 112 |
+
"dec_layers": 7,
|
| 113 |
+
"nheads": 8,
|
| 114 |
+
"camera_names": camera_names,
|
| 115 |
+
"state_dim": state_dim,
|
| 116 |
+
"chunk_size": chunk_size,
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
policy, stats = load_policy(ckpt_dir, ckpt_name, policy_config)
|
| 120 |
+
post_process = lambda a: a * stats["action_std"] + stats["action_mean"]
|
| 121 |
+
|
| 122 |
+
# Create environment
|
| 123 |
+
from tactile_tasks.collect_data import create_env, TASK_CONFIGS
|
| 124 |
+
settle_steps = 50
|
| 125 |
+
max_timesteps = max(TASK_CONFIGS[task]["horizon"], 900)
|
| 126 |
+
env = create_env(task, has_renderer=render)
|
| 127 |
+
env.horizon = max_timesteps + settle_steps
|
| 128 |
+
|
| 129 |
+
sensor = USkinSensor(env.sim)
|
| 130 |
+
query_frequency = 1 if temporal_agg else chunk_size
|
| 131 |
+
|
| 132 |
+
successes = []
|
| 133 |
+
for ep in range(num_rollouts):
|
| 134 |
+
env.reset()
|
| 135 |
+
for _ in range(settle_steps):
|
| 136 |
+
env.step(np.zeros(7))
|
| 137 |
+
|
| 138 |
+
if temporal_agg:
|
| 139 |
+
all_time_actions = torch.zeros(
|
| 140 |
+
[max_timesteps, max_timesteps + chunk_size, state_dim]
|
| 141 |
+
).cuda()
|
| 142 |
+
|
| 143 |
+
all_actions = None
|
| 144 |
+
episode_success = False
|
| 145 |
+
|
| 146 |
+
with torch.inference_mode():
|
| 147 |
+
for t in range(max_timesteps):
|
| 148 |
+
qpos, images = get_obs(env, camera_names, stats)
|
| 149 |
+
tactile = get_tactile(sensor)
|
| 150 |
+
|
| 151 |
+
# Query policy
|
| 152 |
+
if t % query_frequency == 0:
|
| 153 |
+
all_actions = policy(qpos, images, tactile) # (1, chunk_size, state_dim)
|
| 154 |
+
|
| 155 |
+
if temporal_agg:
|
| 156 |
+
all_time_actions[[t], t:t + chunk_size] = all_actions
|
| 157 |
+
actions_for_curr_step = all_time_actions[:, t]
|
| 158 |
+
actions_populated = torch.all(actions_for_curr_step != 0, axis=1)
|
| 159 |
+
actions_for_curr_step = actions_for_curr_step[actions_populated]
|
| 160 |
+
k = 0.01
|
| 161 |
+
exp_weights = np.exp(-k * np.arange(len(actions_for_curr_step)))
|
| 162 |
+
exp_weights = exp_weights / exp_weights.sum()
|
| 163 |
+
exp_weights = torch.from_numpy(exp_weights).cuda().unsqueeze(dim=1)
|
| 164 |
+
raw_action = (actions_for_curr_step * exp_weights).sum(dim=0, keepdim=True)
|
| 165 |
+
else:
|
| 166 |
+
raw_action = all_actions[:, t % query_frequency]
|
| 167 |
+
|
| 168 |
+
# Post-process: denormalize, take first 7D (drop padding dim)
|
| 169 |
+
action = post_process(raw_action.squeeze(0).cpu().numpy())
|
| 170 |
+
action = action[:7] # 8D -> 7D OSC_POSE
|
| 171 |
+
|
| 172 |
+
env.step(action)
|
| 173 |
+
if render:
|
| 174 |
+
env.render()
|
| 175 |
+
|
| 176 |
+
if env._check_success():
|
| 177 |
+
episode_success = True
|
| 178 |
+
|
| 179 |
+
successes.append(episode_success)
|
| 180 |
+
status = "SUCCESS" if episode_success else "FAIL"
|
| 181 |
+
print(f" [{ep+1}/{num_rollouts}] {status} (t={t+1})")
|
| 182 |
+
|
| 183 |
+
success_rate = sum(successes) / len(successes)
|
| 184 |
+
print(f"\n{'='*40}")
|
| 185 |
+
print(f"Task: {task}")
|
| 186 |
+
print(f"Checkpoint: {ckpt_dir}/{ckpt_name}")
|
| 187 |
+
print(f"Mode: {'temporal_agg' if temporal_agg else 'chunk'}")
|
| 188 |
+
print(f"Success: {sum(successes)}/{num_rollouts} ({success_rate*100:.1f}%)")
|
| 189 |
+
print(f"{'='*40}")
|
| 190 |
+
|
| 191 |
+
env.close()
|
| 192 |
+
return success_rate
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
if __name__ == "__main__":
|
| 196 |
+
parser = argparse.ArgumentParser()
|
| 197 |
+
parser.add_argument("--task", type=str, required=True,
|
| 198 |
+
choices=["precision_grasp", "peg_insertion", "gentle_stack"])
|
| 199 |
+
parser.add_argument("--ckpt_dir", type=str, default=None,
|
| 200 |
+
help="checkpoint dir (default: policy/EVA/checkpoints/{task}_eva)")
|
| 201 |
+
parser.add_argument("--ckpt", type=str, default="policy_best.ckpt")
|
| 202 |
+
parser.add_argument("--num_rollouts", type=int, default=5)
|
| 203 |
+
parser.add_argument("--temporal_agg", action="store_true")
|
| 204 |
+
parser.add_argument("--render", action="store_true")
|
| 205 |
+
parser.add_argument("--cameras", nargs="+", default=["agentview", "eye_in_hand"])
|
| 206 |
+
args = parser.parse_args()
|
| 207 |
+
|
| 208 |
+
if args.ckpt_dir is None:
|
| 209 |
+
args.ckpt_dir = os.path.join(
|
| 210 |
+
os.path.dirname(__file__), "..", "policy", "EVA", "checkpoints", f"{args.task}_eva"
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
run_eval(
|
| 214 |
+
task=args.task,
|
| 215 |
+
ckpt_dir=args.ckpt_dir,
|
| 216 |
+
ckpt_name=args.ckpt,
|
| 217 |
+
num_rollouts=args.num_rollouts,
|
| 218 |
+
temporal_agg=args.temporal_agg,
|
| 219 |
+
camera_names=args.cameras,
|
| 220 |
+
render=args.render,
|
| 221 |
+
)
|