-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aloha_hd5 to LerobotDataset v2 #586
base: main
Are you sure you want to change the base?
Conversation
Hi Raziel. Thanks for writing this! I think there is a bug in the implementation you are submitting that results in saving only one frame per episode. The fix should just be to tab in this line https://github.com/huggingface/lerobot/pull/586/files#diff-8a6e4cf809bbdbbde9c6d8d6887e9c3d1537f3dda6179c2bf819a04984bb9fd4R131 |
Hi @Michael-Equi do you mean line 135?
I'm fixing that |
Hi @Michael-Equi, I fixed it if you want to do a double check :) |
"dtype": "video" if encode_as_video else "image", | ||
"shape": cv2.imdecode(hdf5_file[topic][0], 1).transpose(2, 0, 1).shape | ||
if image_compressed | ||
else sample.shape, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does aloha use shape (c, h, w) when uncompressed? I remember it to be (h, w, c)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will give a check, but if I have transposed there, there is a reason that I don't recall right now.
The result seems good here
Hi @Raziel90 I tried but it is very slow, do you know why? |
Hi @Takuzenn can you elaborate what you tried to run and why you think is slow? Have you tried to change set the number of workers? are you converting images to video or are you keeping images? |
What this does
Adds Script for the conversion of aloha_hd5 dataset format to LerobotDataset (v2)
AlohaHD5Extractor
(check code) is providedNB: Automated testing will be provided in a separate PR.
How it was tested
Launched the script to upload the dataset in multiple ways (e.g. images as images or as videos, different episode descriptions)
These datasets are uploaded with this
https://huggingface.co/datasets/ccop/aloha-hd5-conversion-test
https://huggingface.co/datasets/ccop/test-again
Examples:
examples/port_datasets/aloha_hd5.py
How to checkout & try? (for the reviewer)
You can try on an hd5 dataset using the following. (change the arguments to fit your dataset).
python examples/port_datasets/aloha_hd5.py --fps=50 --raw-path=/home/ccop/code/aloha_data/aloha_stationary_pick_place_bottle/ --dataset-repo-id=ccop/test-again --video-encoding=false --push=True --description="Aloha HD5 dataset - Bottle Pick and Place"