-
Notifications
You must be signed in to change notification settings - Fork 77
Transforms tutorial #1123
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
base: main
Are you sure you want to change the base?
Transforms tutorial #1123
Changes from 6 commits
138e22e
408ac57
41e3343
2a16bbd
ba993ad
1a37b74
ade732c
8ea5384
37351c3
3cd8a3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,319 @@ | ||||||||||
| # Copyright (c) Meta Platforms, Inc. and affiliates. | ||||||||||
| # All rights reserved. | ||||||||||
| # | ||||||||||
| # This source code is licensed under the BSD-style license found in the | ||||||||||
| # LICENSE file in the root directory of this source tree. | ||||||||||
|
|
||||||||||
| """ | ||||||||||
| ======================================================= | ||||||||||
| Decoder Transforms: Applying transforms during decoding | ||||||||||
| ======================================================= | ||||||||||
|
|
||||||||||
| In this example, we will demonstrate how to use the ``transforms`` parameter of | ||||||||||
| the :class:`~torchcodec.decoders.VideoDecoder` class. This parameter allows us | ||||||||||
| to specify a list of :class:`torchcodec.transforms.DecoderTransform` or | ||||||||||
| :class:`torchvision.transforms.v2.Transform` objects. These objects serve as | ||||||||||
| transform specificiations that the :class:`~torchcodec.decoders.VideoDecoder` | ||||||||||
|
||||||||||
| will apply during the decoding process. | ||||||||||
| """ | ||||||||||
|
|
||||||||||
| # %% | ||||||||||
| # First, a bit of boilerplate and definitions that we will use later: | ||||||||||
|
||||||||||
| # %% | |
| # First, a bit of boilerplate: we'll download a video from the web, and define a | |
| # plotting utility. You can ignore that part and jump right below to | |
| # :ref:`sampling_tuto_start`. |
NicolasHug marked this conversation as resolved.
Show resolved
Hide resolved
NicolasHug marked this conversation as resolved.
Show resolved
Hide resolved
NicolasHug marked this conversation as resolved.
Show resolved
Hide resolved
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.
Would it be worth mentioning decoder native transforms in the performance tips docs?
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.
@mollyxu, yes, absolutely. I'd like to do that in a follow-up PR.
Uh oh!
There was an error while loading. Please reload this page.