-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add mcap frame and tabular readers - abstract tabular source processing - slimmer configs - add `read-frames` script
- Loading branch information
1 parent
09d5b31
commit f894e58
Showing
56 changed files
with
1,663 additions
and
1,058 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
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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
defaults: | ||
- table_builder: !!null | ||
- _self_ | ||
|
||
path: ??? | ||
writer: | ||
_target_: polars.DataFrame.write_csv | ||
_partial_: true | ||
file: ??? | ||
|
||
hydra: | ||
output_subdir: !!null | ||
run: | ||
dir: . |
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,44 +1,61 @@ | ||
#@yaml/text-templated-strings | ||
|
||
#@ drives = [ | ||
#@ 'carla_id1', | ||
#@ ] | ||
|
||
#@ cameras = [ | ||
#@ 'cam_front_left', | ||
#@ ] | ||
--- | ||
_target_: rbyte.Dataset | ||
_recursive_: false | ||
config: | ||
inputs: | ||
- id: carla_id1 | ||
sources: | ||
frame: | ||
- id: cam_front_left | ||
index_column: frame_idx | ||
reader: | ||
_target_: rbyte.io.frame.jpeg.JpegFrameReader | ||
path: "${data_dir}/${.....id}/frames/${..id}.defish.mp4/576x324/{:09d}.jpg" | ||
|
||
table: | ||
path: ${data_dir}/${...id}/ego_logs.json | ||
builder: | ||
_target_: rbyte.io.table.carla.CarlaRecordsTableBuilder | ||
_recursive_: false | ||
config: | ||
index_column: frame_idx | ||
select: | ||
- control.brake | ||
- control.throttle | ||
- control.steer | ||
- state.velocity.value | ||
- state.acceleration.value | ||
_convert_: all | ||
inputs: | ||
#@ for input_id in drives: | ||
(@=input_id@): | ||
frame: | ||
#@ for source_id in cameras: | ||
(@=source_id@): | ||
index_column: frame_idx | ||
reader: | ||
_target_: rbyte.io.frame.DirectoryFrameReader | ||
path: "${data_dir}/(@=input_id@)/frames/(@=source_id@).defish.mp4/576x324/{:09d}.jpg" | ||
frame_decoder: | ||
_target_: simplejpeg.decode_jpeg | ||
_partial_: true | ||
colorspace: rgb | ||
fastdct: true | ||
fastupsample: true | ||
|
||
filter: | | ||
`control.throttle` > 0.5 | ||
#@ end | ||
|
||
transforms: | ||
- _target_: rbyte.io.table.transforms.FpsResampler | ||
source_fps: 20 | ||
target_fps: 30 | ||
samples: | ||
builder: | ||
_target_: rbyte.sample.builder.GreedySampleTableBuilder | ||
config: | ||
table: | ||
path: ${data_dir}/(@=input_id@)/ego_logs.json | ||
builder: | ||
_target_: rbyte.io.table.carla.CarlaRecordsTableBuilder | ||
_convert_: all | ||
index_column: frame_idx | ||
length: 1 | ||
stride: 1 | ||
min_step: 1 | ||
filter: !!null | ||
select: | ||
- control.brake | ||
- control.throttle | ||
- control.steer | ||
- state.velocity.value | ||
- state.acceleration.value | ||
|
||
filter: | | ||
`control.throttle` > 0.5 | ||
transforms: | ||
- _target_: rbyte.io.table.transforms.FpsResampler | ||
source_fps: 20 | ||
target_fps: 30 | ||
#@ end | ||
|
||
sample_builder: | ||
_target_: rbyte.sample.builder.GreedySampleTableBuilder | ||
index_column: frame_idx | ||
length: 1 | ||
stride: 1 | ||
min_step: 1 | ||
filter: !!null |
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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#@yaml/text-templated-strings | ||
|
||
#@ drives = [ | ||
#@ 'Niro102-HQ/2023-05-08--13-59-22', | ||
#@ ] | ||
|
||
#@ cameras = [ | ||
#@ 'cam_front_left', | ||
#@ 'cam_left_forward', | ||
#@ 'cam_right_forward', | ||
#@ ] | ||
--- | ||
_target_: rbyte.Dataset | ||
_convert_: all | ||
_recursive_: false | ||
inputs: | ||
#@ for input_id in drives: | ||
(@=input_id@): | ||
frame: | ||
#@ for source_id in cameras: | ||
(@=source_id@): | ||
index_column: /camera/(@=source_id@)/frame_idx | ||
reader: | ||
_target_: rbyte.io.frame.mcap.McapFrameReader | ||
path: "${data_dir}/(@=input_id@)/drive.mcap" | ||
topic: /camera/(@=source_id@) | ||
message_decoder_factory: | ||
_target_: mcap_protobuf.decoder.DecoderFactory | ||
frame_decoder: | ||
_target_: simplejpeg.decode_jpeg | ||
_partial_: true | ||
colorspace: rgb | ||
fastdct: true | ||
fastupsample: true | ||
#@ end | ||
|
||
table: | ||
path: "${data_dir}/(@=input_id@)/drive.mcap" | ||
builder: | ||
_target_: rbyte.io.table.TableBuilder | ||
reader: | ||
_target_: rbyte.io.table.mcap.McapProtobufTableReader | ||
_recursive_: false | ||
_convert_: all | ||
fields: | ||
#@ for camera in cameras: | ||
/camera/(@=camera@): | ||
timestamp: | ||
_target_: polars.Datetime | ||
time_unit: ns | ||
#@ end | ||
|
||
/sensor/vehicle_motion: | ||
time_stamp: | ||
_target_: polars.Datetime | ||
time_unit: ns | ||
|
||
speed: polars.Float32 | ||
gear: | ||
_target_: polars.Enum | ||
categories: ["0", "1", "2", "3"] | ||
|
||
merger: | ||
_target_: rbyte.io.table.TableMerger | ||
separator: / | ||
merge: | ||
/camera/(@=cameras[0]@): | ||
timestamp: | ||
method: ref | ||
|
||
#@ for camera in cameras[1:]: | ||
/camera/(@=camera@): | ||
timestamp: | ||
method: ref | ||
|
||
frame_idx: | ||
method: asof | ||
tolerance: 10ms | ||
strategy: nearest | ||
#@ end | ||
|
||
/sensor/vehicle_motion: | ||
time_stamp: | ||
method: ref | ||
speed: | ||
method: interp | ||
gear: | ||
method: asof | ||
tolerance: 100ms | ||
|
||
filter: | | ||
`/sensor/vehicle_motion/gear` == '3' | ||
cache: | ||
_target_: rbyte.utils.dataframe.DataframeDiskCache | ||
directory: /tmp/rbyte-cache | ||
size_limit: 1GiB | ||
#@ end | ||
|
||
sample_builder: | ||
_target_: rbyte.sample.builder.GreedySampleTableBuilder | ||
index_column: /camera/cam_front_left/frame_idx | ||
length: 6 | ||
stride: 1 | ||
min_step: 6 | ||
filter: | | ||
array_mean(`/sensor/vehicle_motion/speed`) > 47 |
Oops, something went wrong.