Spaces:
Running
Running
File size: 1,480 Bytes
2cbfbf8 4b31140 2cbfbf8 4b31140 2cbfbf8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | /**
* Centralized constants for the lerobot-dataset-visualizer
* Eliminates magic numbers and provides single source of truth for configuration
*/
// Formatting constants for episode and file indexing
export const PADDING = {
EPISODE_CHUNK: 3,
EPISODE_INDEX: 6,
FILE_INDEX: 3,
CHUNK_INDEX: 3,
} as const;
// Numeric thresholds for data processing
export const THRESHOLDS = {
SCALE_GROUPING: 2,
EPSILON: 1e-9,
VIDEO_SYNC_TOLERANCE: 0.2,
VIDEO_SEGMENT_BOUNDARY: 0.05,
} as const;
// Chart configuration
export const CHART_CONFIG = {
MAX_SERIES_PER_GROUP: 6,
SERIES_NAME_DELIMITER: " | ",
} as const;
// Video player configuration
export const VIDEO_PLAYER = {
JUMP_SECONDS: 5,
STEP_SIZE: 0.01,
DEBOUNCE_MS: 200,
} as const;
// HTTP configuration
export const HTTP = {
TIMEOUT_MS: 10000,
} as const;
// Excluded columns by dataset version.
// Reserved names from lerobot: `next.reward`, `next.done`, `next.truncated` are
// auto-populated step signals and should not be rendered as chart series.
// `subtask_index` is the v3.0 subtask pointer (maps into meta/subtasks.parquet).
export const EXCLUDED_COLUMNS = {
V2: [
"timestamp",
"frame_index",
"episode_index",
"index",
"task_index",
"next.reward",
"next.done",
"next.truncated",
],
V3: [
"index",
"task_index",
"episode_index",
"frame_index",
"next.reward",
"next.done",
"next.truncated",
"subtask_index",
],
} as const;
|