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

[DataPipe] file decoder #401

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

[DataPipe] file decoder #401

wants to merge 2 commits into from

Conversation

tmbdev
Copy link
Contributor

@tmbdev tmbdev commented May 13, 2022

This PR adds a filter that simplifies file decoding for archive files. It allows glob patterns to be matched against a stream of (filename, stream) pairs and invokes the corresponding decoder on the stream.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 13, 2022
@msaroufim msaroufim requested review from ejguan and msaroufim May 17, 2022 00:09
return pickle.load(stream)


default_decoders = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wenleix I like this feels like a natural place to add more exotic decoders like NVJpeg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image decoders depend on third party libraries. Furthermore, the output people desire from image decoders (PIL, tensor, ndarray, ...) depends on what data augmentation pipeline they use. That's why image decoders aren't present by default. Users can select the image decoder they want to use with just a single line.

Of course, if you prefer, we could pick a default for image decoding.

There are a few more default decoders one might want to add (e.g., JSON).

@NivekT NivekT changed the title file decoder [DataPipe] file decoder May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants