-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix split optional requirement (#11)
- Loading branch information
Showing
2 changed files
with
23 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
import fog_x | ||
|
||
# create a new dataset | ||
# 🦊 Dataset Creation | ||
# from distributed dataset storage | ||
dataset = fog_x.Dataset( | ||
name="test_rtx", | ||
path="/tmp/rtx", | ||
) | ||
|
||
# create a new episode / trajectory | ||
trajectory = dataset.new_episode() | ||
trajectory.add(feature="hello", value=1.0) | ||
trajectory.add(feature="world", value=2.0) | ||
trajectory.close() | ||
name="demo_ds", | ||
path="~/test_dataset", # can be AWS S3, Google Bucket! | ||
) | ||
|
||
# iterate through the dataset | ||
for episode in dataset.read_by( | ||
pandas_metadata=dataset.get_metadata_as_pandas_df() | ||
): | ||
print(episode) | ||
# 🦊 Data collection: | ||
# create a new trajectory | ||
episode = dataset.new_episode() | ||
# collect step data for the episode | ||
episode.add(feature = "arm_view", value = "image1.jpg") | ||
# Automatically time-aligns and saves the trajectory | ||
episode.close() | ||
|
||
# export the dataset as standard rt-x format | ||
dataset.export( | ||
"/tmp/rtx_export", format="rtx", obs_keys=["hello"], act_keys=["world"] | ||
# 🦊 Data Loading: | ||
# load from existing RT-X/Open-X datasets | ||
dataset.load_rtx_episodes( | ||
name="berkeley_autolab_ur5", | ||
additional_metadata={"collector": "User 2"} | ||
) | ||
|
||
# 🦊 Data Management and Analytics: | ||
# Compute and memory efficient filter, map, aggregate, groupby | ||
episode_info = dataset.get_episode_info() | ||
desired_episodes = episode_info.filter(episode_info["collector"] == "User 2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters