File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,10 @@ def chunk_actions(traj):
116116
117117 dataset = dataset .traj_map (chunk_actions , num_parallel_calls )
118118
119+ # Flatten: map from trajectory dataset to dataset of individual action chunks
120+ dataset = dataset .flatten (num_parallel_calls = num_parallel_calls )
121+
122+ # Filter out frames where actions are idle. Must be done after flattening, as filter should apply per-frame.
119123 def filter_idle (traj ):
120124 """Filter out chunks with idle actions.
121125 --> we filter if at least first half of chunk does not move.
@@ -127,9 +131,6 @@ def filter_idle(traj):
127131
128132 dataset = dataset .filter (filter_idle )
129133
130- # Flatten: map from trajectory dataset to dataset of individual action chunks
131- dataset = dataset .flatten (num_parallel_calls = num_parallel_calls )
132-
133134 # Decode images: RLDS saves encoded images, only decode now for efficiency
134135 def decode_images (traj ):
135136 traj ["observation" ]["image" ] = tf .io .decode_image (
You can’t perform that action at this time.
0 commit comments