Skip to content
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

Video support #7230

Merged
merged 17 commits into from
Oct 24, 2024
Merged

Video support #7230

merged 17 commits into from
Oct 24, 2024

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Oct 15, 2024

(wip and experimental)

adding the Video type based on VideoReader from decord

>>>from datasets import load_dataset
>>> ds = load_dataset("path/to/videos", split="train").with_format("torch")
>>> print(ds[0]["video"])
<decord.video_reader.VideoReader object at 0x337a47910>
>>> print(ds[0]["video"][0])
tensor([[[73, 73, 73],
         [73, 73, 73],
         [73, 73, 73],
         ...,
         [23, 23, 23],
         [23, 23, 23],
         [23, 23, 23]]], dtype=torch.uint8)

the storage is the same as for audio and images: {"path": pa.string(), "bytes": pa.binary()} and I did a small to keep the hf:// URL in the "path" field if possible, this way the viewer can link to fiels on the hub if possible

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@lhoestq lhoestq marked this pull request as ready for review October 24, 2024 15:09
@lhoestq lhoestq merged commit 8235fdb into main Oct 24, 2024
15 checks passed
@lhoestq lhoestq deleted the video branch October 24, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants