Delete agilex_benchmark_data.py
#2
by michaelyeah7 - opened
- agilex_benchmark_data.py +0 -32
agilex_benchmark_data.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
# agilex_benchmark_data.py - 三个 split: folding, passing, peg
|
| 2 |
-
import glob
|
| 3 |
-
import os
|
| 4 |
-
import datasets
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
class AgilexBenchmarkData(datasets.GeneratorBasedBuilder):
|
| 8 |
-
"""Agilex benchmark 非相机数据,三个 split: folding, passing, peg。"""
|
| 9 |
-
|
| 10 |
-
def _info(self):
|
| 11 |
-
return datasets.DatasetInfo(
|
| 12 |
-
description="Agilex robot benchmark data (no camera). Three splits: folding, passing, peg.",
|
| 13 |
-
features=datasets.Features({
|
| 14 |
-
"split": datasets.Value("string"),
|
| 15 |
-
"episode_file": datasets.Value("string"),
|
| 16 |
-
}),
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
-
def _split_generators(self, dl_manager):
|
| 20 |
-
script_dir = os.path.dirname(os.path.abspath(__file__))
|
| 21 |
-
return [
|
| 22 |
-
datasets.SplitGenerator(name=datasets.NamedSplit("folding"), gen_kwargs={"data_dir": script_dir, "split": "folding"}),
|
| 23 |
-
datasets.SplitGenerator(name=datasets.NamedSplit("passing"), gen_kwargs={"data_dir": script_dir, "split": "passing"}),
|
| 24 |
-
datasets.SplitGenerator(name=datasets.NamedSplit("peg"), gen_kwargs={"data_dir": script_dir, "split": "peg"}),
|
| 25 |
-
]
|
| 26 |
-
|
| 27 |
-
def _generate_examples(self, data_dir, split):
|
| 28 |
-
folder = os.path.join(data_dir, split)
|
| 29 |
-
if not os.path.isdir(folder):
|
| 30 |
-
return
|
| 31 |
-
for idx, path in enumerate(sorted(glob.glob(os.path.join(folder, "*.hdf5")))):
|
| 32 |
-
yield idx, {"split": split, "episode_file": os.path.relpath(path, data_dir)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|