Fxxkrobotics commited on
Commit
bdd5148
·
verified ·
1 Parent(s): 97ad049

Add files using upload-large-folder tool

Browse files
Files changed (44) hide show
  1. policy/EVA/checkpoints/peg_insertion_eva/dataset_stats.pkl +3 -0
  2. policy/EVA/checkpoints/peg_insertion_eva/train_val_event_seed_1.png +3 -0
  3. policy/EVA/checkpoints/peg_insertion_eva/train_val_kl_seed_1.png +3 -0
  4. policy/EVA/checkpoints/peg_insertion_eva/train_val_l1_seed_1.png +3 -0
  5. policy/EVA/checkpoints/peg_insertion_eva/train_val_loss_seed_1.png +3 -0
  6. policy/EVA/data_diagnosis.png +3 -0
  7. policy/EVA/imitate_episodes.py +2 -4
  8. policy/EVA/process_data.py +6 -5
  9. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_10.hdf5 +1 -1
  10. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_13.hdf5 +1 -1
  11. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_14.hdf5 +1 -1
  12. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_16.hdf5 +1 -1
  13. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_17.hdf5 +1 -1
  14. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_18.hdf5 +1 -1
  15. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_19.hdf5 +1 -1
  16. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_2.hdf5 +1 -1
  17. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_20.hdf5 +1 -1
  18. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_21.hdf5 +1 -1
  19. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_24.hdf5 +1 -1
  20. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_25.hdf5 +1 -1
  21. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_27.hdf5 +1 -1
  22. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_28.hdf5 +1 -1
  23. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_3.hdf5 +1 -1
  24. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_30.hdf5 +1 -1
  25. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_31.hdf5 +1 -1
  26. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_32.hdf5 +1 -1
  27. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_33.hdf5 +1 -1
  28. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_35.hdf5 +1 -1
  29. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_36.hdf5 +1 -1
  30. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_37.hdf5 +1 -1
  31. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_38.hdf5 +1 -1
  32. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_39.hdf5 +1 -1
  33. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_41.hdf5 +1 -1
  34. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_43.hdf5 +1 -1
  35. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_44.hdf5 +1 -1
  36. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_46.hdf5 +1 -1
  37. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_47.hdf5 +1 -1
  38. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_48.hdf5 +1 -1
  39. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_49.hdf5 +1 -1
  40. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_5.hdf5 +1 -1
  41. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_7.hdf5 +1 -1
  42. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_8.hdf5 +1 -1
  43. policy/EVA/processed_data/sim-peg_insertion/default-50/episode_9.hdf5 +1 -1
  44. 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

  • SHA256: 40cc581f32338e8dbbe0ec96b21f7bb44db76461126cf143f6223796c533cd32
  • Pointer size: 130 Bytes
  • Size of remote file: 27 kB
policy/EVA/checkpoints/peg_insertion_eva/train_val_kl_seed_1.png ADDED

Git LFS Details

  • SHA256: 170ffc040146b2cd4249aebe2601b81ee60d7a1243b1a99bb4c1bf7df8e96d0a
  • Pointer size: 130 Bytes
  • Size of remote file: 15.2 kB
policy/EVA/checkpoints/peg_insertion_eva/train_val_l1_seed_1.png ADDED

Git LFS Details

  • SHA256: ab5159359e5405b5538d2d780ec2156f3e1140f861206dbffcf9b05f6d104509
  • Pointer size: 130 Bytes
  • Size of remote file: 26.5 kB
policy/EVA/checkpoints/peg_insertion_eva/train_val_loss_seed_1.png ADDED

Git LFS Details

  • SHA256: 7698a95e4b804e9eb3a902d7ee950357d3cd3b6cda178f69cbce84a6ab704297
  • Pointer size: 130 Bytes
  • Size of remote file: 18.6 kB
policy/EVA/data_diagnosis.png ADDED

Git LFS Details

  • SHA256: e1ccde3e45ff24b0b8a4208cbbeea7b5bb80e02fe14839fc4f80bb20816f304b
  • Pointer size: 131 Bytes
  • Size of remote file: 318 kB
policy/EVA/imitate_episodes.py CHANGED
@@ -82,10 +82,8 @@ def main(args):
82
  }
83
 
84
  if is_eval:
85
- ckpt_name = "policy_best.ckpt"
86
- print(f"Evaluating {ckpt_name}...")
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: same as qpos (next-step joint target), following ACT convention
56
- # Use qpos[1:] as action for qpos[:-1], pad last with repeat
57
- action = np.zeros_like(qpos)
58
- action[:-1] = qpos[1:]
59
- action[-1] = qpos[-1]
 
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:754f35d7f400e34c7cff6f07ad68e2a7283f479c7b145c4e4940abf40e3e4111
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:7d75e048c50c79229c63d49f161d7abe91431e88509b30d56f5e3677a0fb3a07
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:a5ae6ca4b8260915b08fcc3e61e413600bdc2b3ba7280894400cf7612149afe0
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:e50076477c88ca609868156efc0cc28ced1e99b7f89c512f484574e7bb5f4233
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:13b08eb0e001e12c2fdd73c005f6207f669d7610488959c4d39e875f5dc9ba96
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:08f3b651840b910dd1d7f0d0ff9cf2e4ecf99bc64f163e49a42ee01d426024c9
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:944579a5c11bf406131bb374bd00ad08d30fa5a6fe17a7baf413ef35b2682b39
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:8cb3b8ace419ff4aa5b3305f491e76dee482d737575db013a8d0c4e142aa878f
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:a80b7498f4cb7bd496bc851095f0bf05b276d39406074866aaa5918b7183a33e
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:b6309e07ffb350088749cc1d81dc480aaa271a135f1cd1013c0b0d41bd99e566
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:90117a0c4fd1ca469e0defd5efee287ad09787ca373033b063b271eea7e7b68e
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:ffbc3320742b81a2256fc11ea4176b127f8da52bfadb1fb642d6779287ff42ed
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:725ca659a6b077e496bb084a62045aacc862302c12aa9a168594101d8e45043a
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:47d94176498d63c015f101a4d827e5967cddf4b60817cbb2e0f9f66df4912174
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:1d8d43144bd49496cdee98d7b77418435b4e0a6158bf36e883144253be88a7d8
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:c1b38e4afa9fee93a4081db87bf8214a5750a89633338996d10d78e9e27471ab
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:ff93391dcb2190676bd78514ecab02cee1ced1bf17c15fc76c7a9c9148d4b40c
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:b0baf40b2810e6410699e8eb0dd363a6bf7318536f9f910008f377a61d96c31f
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:c52e8a0f7c79ea527049f871a3d43669b1c4446c062b30c36064e8b76008a982
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:5a0a78369d6db3696b0b78ad7895896d69af3c4b479523a8fa7e4a47d97be86c
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:3c5b3f1d73f894c5466594d711925fc16d5284c9a06483a895ad2372f1f0a421
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:b64437d7df940a370ea6abed257c8293318b62c9118b3a3e108ff23b5214b258
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:43371f3bb9b42691ec79876cd30c9cc277299a99ee55a162eeedfb02a6cb6e32
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:349634a5f2aea7f8718d037259e708115a315d5d28fcb4f6ca8610a5fe0e6d3a
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:d5b2b03a8960d1da28f136bcd591b09e4eb7b62dc08603f12722ad241f7fc6a5
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:9860052508259d758a7f8d6de7e486bbf83014b050bdbcc48f156f723ae0baaf
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:3ce6f3ee317871ebc4fa06afcc0129fea7fd19b981b4dbae13f1e35522b912e6
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:d703e2eec889fc118853d04e920d4fbad6ee605b013a8d992d1c52b91db47b29
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:ac1a4159de26ab41d8c9fd171adf79987ed4400d4e04c8940aa85db5bc9ce535
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:fcdd231af21c9a0510d3e4bcad923eb083a4d7366fe1177dcbd472a9e2d8978a
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:b4c1f47a40b6f60509cbc37414f00fda3d14deee4dbeae4c1b9e45e9b2e1bf27
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:fc39566a0181b9d309f15b52c51f1d95c181371ba25e1715f96fba6f9a33b448
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:02a7b7b07b0d0bf57615b5fe4157f264aa0a45f28d50496c167dec156aaa7342
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:8fc71d2e05d83e02e7f372513292f96149ab1c1c4b09c7fbd2b438521ee384bc
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:671ff71b6f036a7d66e8b9e66605917581693a25e80533422e3ccd778d26caf4
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
+ )