forked from tangger/lerobot
Remove dead code & cleanup
This commit is contained in:
@@ -38,6 +38,7 @@ from lerobot.common.datasets.utils import (
|
|||||||
DEFAULT_IMAGE_PATH,
|
DEFAULT_IMAGE_PATH,
|
||||||
INFO_PATH,
|
INFO_PATH,
|
||||||
TASKS_PATH,
|
TASKS_PATH,
|
||||||
|
_validate_feature_names,
|
||||||
append_jsonlines,
|
append_jsonlines,
|
||||||
backward_compatible_episodes_stats,
|
backward_compatible_episodes_stats,
|
||||||
check_delta_timestamps,
|
check_delta_timestamps,
|
||||||
@@ -314,23 +315,9 @@ class LeRobotDatasetMetadata:
|
|||||||
|
|
||||||
obj.root.mkdir(parents=True, exist_ok=False)
|
obj.root.mkdir(parents=True, exist_ok=False)
|
||||||
|
|
||||||
# if robot is not None:
|
|
||||||
# features = get_features_from_robot(robot, use_videos)
|
|
||||||
# robot_type = robot.robot_type
|
|
||||||
# if not all(cam.fps == fps for cam in robot.cameras.values()):
|
|
||||||
# logging.warning(
|
|
||||||
# f"Some cameras in your {robot.robot_type} robot don't have an fps matching the fps of your dataset."
|
|
||||||
# "In this case, frames from lower fps cameras will be repeated to fill in the blanks."
|
|
||||||
# )
|
|
||||||
|
|
||||||
# TODO(aliberts, rcadene): implement sanity check for features
|
# TODO(aliberts, rcadene): implement sanity check for features
|
||||||
features = {**features, **DEFAULT_FEATURES}
|
features = {**features, **DEFAULT_FEATURES}
|
||||||
|
_validate_feature_names(features)
|
||||||
# check if none of the features contains a "/" in their names,
|
|
||||||
# as this would break the dict flattening in the stats computation, which uses '/' as separator
|
|
||||||
for key in features:
|
|
||||||
if "/" in key:
|
|
||||||
raise ValueError(f"Feature names should not contain '/'. Found '/' in feature '{key}'.")
|
|
||||||
|
|
||||||
obj.tasks, obj.task_to_task_index = {}, {}
|
obj.tasks, obj.task_to_task_index = {}, {}
|
||||||
obj.episodes_stats, obj.stats, obj.episodes = {}, {}, {}
|
obj.episodes_stats, obj.stats, obj.episodes = {}, {}, {}
|
||||||
|
|||||||
@@ -243,10 +243,6 @@ def record(cfg: RecordConfig) -> LeRobotDataset:
|
|||||||
cfg.dataset.repo_id,
|
cfg.dataset.repo_id,
|
||||||
root=cfg.dataset.root,
|
root=cfg.dataset.root,
|
||||||
)
|
)
|
||||||
# for key, ft in dataset_features.items():
|
|
||||||
# for property in ["dtype", "shape", "names"]:
|
|
||||||
# if ft[property] != dataset.features[key][property]:
|
|
||||||
# raise ValueError(ft)
|
|
||||||
|
|
||||||
if hasattr(robot, "cameras") and len(robot.cameras) > 0:
|
if hasattr(robot, "cameras") and len(robot.cameras) > 0:
|
||||||
dataset.start_image_writer(
|
dataset.start_image_writer(
|
||||||
@@ -277,22 +273,6 @@ def record(cfg: RecordConfig) -> LeRobotDataset:
|
|||||||
|
|
||||||
listener, events = init_keyboard_listener()
|
listener, events = init_keyboard_listener()
|
||||||
|
|
||||||
# Execute a few seconds without recording to:
|
|
||||||
# 1. teleoperate the robot to move it in starting position if no policy provided,
|
|
||||||
# 2. give times to the robot devices to connect and start synchronizing,
|
|
||||||
# 3. place the cameras windows on screen
|
|
||||||
# enable_teleoperation = policy is None
|
|
||||||
# log_say("Warmup record", cfg.play_sounds)
|
|
||||||
# record_loop(
|
|
||||||
# robot=robot,
|
|
||||||
# control_time_s=cfg.warmup_time_s,
|
|
||||||
# display_data=cfg.display_data,
|
|
||||||
# events=events,
|
|
||||||
# fps=cfg.dataset.fps,
|
|
||||||
# teleoperate=enable_teleoperation,
|
|
||||||
# )
|
|
||||||
# warmup_record(robot, events, enable_teleoperation, cfg.warmup_time_s, cfg.display_data, cfg.dataset.fps)
|
|
||||||
|
|
||||||
for recorded_episodes in range(cfg.dataset.num_episodes):
|
for recorded_episodes in range(cfg.dataset.num_episodes):
|
||||||
log_say(f"Recording episode {dataset.num_episodes}", cfg.play_sounds)
|
log_say(f"Recording episode {dataset.num_episodes}", cfg.play_sounds)
|
||||||
record_loop(
|
record_loop(
|
||||||
|
|||||||
Reference in New Issue
Block a user