[python] Support custom dataset readers in PaimonLeRobotDataset - #9785
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
Reviewed 1cf87f1. Requirement fit: SUPPORTED. Implementation: CLEAN in the reviewed reader contracts.
Custom storage layouts can now provide logical frames while reusing the existing episode selection, delta windows and sample assembly. The boundary is small enough to be useful: read_indices supplies rows, and the shared reader validates completeness, uniqueness and control columns before assembling samples. The facade also preserves the existing table-backed path and explicitly avoids forwarding pickle special methods. The LeRobot reader reference supports this division of responsibilities; direct integration with LeRobot's backend registry remains future work.
I checked batch ordering, episode remapping, schema/media contracts and serialization ownership. The available environment passed 39 tests and additional real-Arrow custom-reader probes; 38 optional tests were skipped. Three full-file failures reproduce unchanged on the exact base. Torch/media/DataLoader end-to-end execution was unavailable locally; current PR CI is successful. No actionable introduced regression found.
Purpose
Let
PaimonLeRobotDatasetread logical frames through custom dataset readers.Changes
PaimonDatasetReader: metadata, logical frame schema, validated batched row reads, delta windows, media decoding, and Torch conversion.PaimonLeRobotDataseta Dataset facade overPaimonDatasetReader.PaimonDatasetReaderthrough the same constructor.Custom readers implement
read_indices.schemaenables eager validation;file_iois required only for BLOB or video descriptors. Reader instances must be picklable for DataLoader workers.Relationship to LeRobot
LeRobot
mainselects aBaseDatasetReaderbymeta.storage_format. The reader owns row access, delta windows, media decoding, and returns assembled samples.The
BaseDatasetReadersource docstring explicitly lets subclasses define their own constructors because storage inputs differ.schemaandfile_ioare PyPaimon-specific inputs, not LeRobot parameters.PaimonDatasetReadermirrors the official Reader responsibilities. Once the official contract is available in PyPaimon's supported LeRobot range, it can implementBaseDatasetReaderwithout changing custom row-resolution code.Official references:
BaseDatasetReader,storage_formatreader lookup.Review focus
Is the minimum custom-reader contract (
read_indices, plus optionalschemaandfile_io) sufficient while keeping sample assembly in one Reader?Tests
80 passedinmultimodal_lerobot_test.py.git diff --checkpass.