(fn: Callable[[Dict], Dict], frame: Dict)
| 394 | # Convenience wrapper that takes a function that operates on a non-chunked "observation" dict and applies |
| 395 | # it to the chunked "observation" dict as well as the non-chunked "task" dict |
| 396 | def apply_obs_transform(fn: Callable[[Dict], Dict], frame: Dict) -> Dict: |
| 397 | frame["task"] = fn(frame["task"]) |
| 398 | frame["observation"] = dl.vmap(fn)(frame["observation"]) |
| 399 | return frame |
| 400 | |
| 401 | # Decode + resize images (and depth images) |
| 402 | dataset = dataset.frame_map( |