From b3f55aabcfb8b6ca205df594638e9fec19b839c6 Mon Sep 17 00:00:00 2001 From: nateraw Date: Tue, 25 May 2021 13:57:14 -0700 Subject: [PATCH] Add missing lambda to transforms in tutorial (#49) Summary: ## Motivation and Context Closes https://github.com/facebookresearch/pytorchvideo/issues/32 by adding lambda in the tutorial. Code changes to be made in https://github.com/facebookresearch/pytorchvideo/issues/41 - this is just a quickfix. ## How Has This Been Tested ## Types of changes - [x] Docs change / refactoring / dependency upgrade - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist - [x] My code follows the code style of this project. - [x] My change requires a change to the documentation. - [x] I have updated the documentation accordingly. - [x] I have read the **CONTRIBUTING** document. - [x] I have completed my CLA (see **CONTRIBUTING**) - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Pull Request resolved: https://github.com/facebookresearch/pytorchvideo/pull/49 Reviewed By: tullie Differential Revision: D28685418 Pulled By: kalyanvasudev fbshipit-source-id: 0984c0433119be11c768d784e1c05d22ffec4729 --- website/docs/tutorial_classification.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/tutorial_classification.md b/website/docs/tutorial_classification.md index 86e5f2b2..881d6720 100644 --- a/website/docs/tutorial_classification.md +++ b/website/docs/tutorial_classification.md @@ -101,6 +101,7 @@ from pytorchvideo.transforms import ( from torchvision.transforms import ( Compose, + Lambda, RandomCrop, RandomHorizontalFlip ) @@ -122,6 +123,7 @@ class KineticsDataModule(pytorch_lightning.LightningDataModule): transform=Compose( [ UniformTemporalSubsample(8), + Lambda(lambda x: x / 255.0), Normalize((0.45, 0.45, 0.45), (0.225, 0.225, 0.225)), RandomShortSideScale(min_size=256, max_size=320), RandomCrop(244),