Skip to content

Commit

Permalink
Add small images to parquet output.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 718878698
  • Loading branch information
jzxu authored and copybara-github committed Jan 23, 2025
1 parent c575efe commit 269b507
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/skai/generate_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,8 @@ def _example_to_dict(
features['post_image_png_large'] = utils.get_bytes_feature(
e, 'post_image_png_large'
)[0]
features['pre_image_png'] = utils.get_bytes_feature(e, 'pre_image_png')[0]
features['post_image_png'] = utils.get_bytes_feature(e, 'post_image_png')[0]
return features


Expand Down Expand Up @@ -1169,6 +1171,8 @@ def _write_examples_to_parquet(
('label', pyarrow.float64()),
('pre_image_png_large', pyarrow.binary()),
('post_image_png_large', pyarrow.binary()),
('pre_image_png', pyarrow.binary()),
('post_image_png', pyarrow.binary()),
])
_ = (
examples
Expand Down

0 comments on commit 269b507

Please sign in to comment.