From 717600d96de43a9f1ebfcf4d321d982480bee7de Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 24 Feb 2023 10:13:58 +0100 Subject: [PATCH 1/3] hide sphinx gallery config comments --- docs/source/conf.py | 1 + gallery/plot_transforms_v2_e2e.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 304a1cc6e22..8b4ce17de9f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -62,6 +62,7 @@ "gallery_dirs": "auto_examples", # path to where to save gallery generated output "backreferences_dir": "gen_modules/backreferences", "doc_module": ("torchvision",), + "remove_config_comments": True, } napoleon_use_ivar = True diff --git a/gallery/plot_transforms_v2_e2e.py b/gallery/plot_transforms_v2_e2e.py index 938578e4af9..026fe42249a 100644 --- a/gallery/plot_transforms_v2_e2e.py +++ b/gallery/plot_transforms_v2_e2e.py @@ -20,7 +20,6 @@ import torchvision -# sphinx_gallery_thumbnail_number = -1 def show(sample): import matplotlib.pyplot as plt @@ -99,9 +98,7 @@ def load_example_coco_detection_dataset(**kwargs): transform = transforms.Compose( [ transforms.RandomPhotometricDistort(), - transforms.RandomZoomOut( - fill=defaultdict(lambda: 0, {PIL.Image.Image: (123, 117, 104)}) - ), + transforms.RandomZoomOut(fill=defaultdict(lambda: 0, {PIL.Image.Image: (123, 117, 104)})), transforms.RandomIoUCrop(), transforms.RandomHorizontalFlip(), transforms.ToImageTensor(), @@ -125,6 +122,7 @@ def load_example_coco_detection_dataset(**kwargs): torch.manual_seed(3141) sample = dataset[0] +# sphinx_gallery_thumbnail_number = 2 show(sample) From dabaa9d7a447682b73a76ce5d88794a48013a44e Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 24 Feb 2023 10:14:08 +0100 Subject: [PATCH 2/3] typo --- gallery/plot_transforms_v2_e2e.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gallery/plot_transforms_v2_e2e.py b/gallery/plot_transforms_v2_e2e.py index 026fe42249a..7339bbbcf41 100644 --- a/gallery/plot_transforms_v2_e2e.py +++ b/gallery/plot_transforms_v2_e2e.py @@ -1,6 +1,6 @@ """ ================================================== -transforms v2: End-to-end object detection example +Transforms v2: End-to-end object detection example ================================================== Object detection is not supported out of the box by ``torchvision.transforms`` v1, since it only supports images. From e6453efff6580829c2a6ec0fcd257bd468362c8a Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 24 Feb 2023 10:18:00 +0100 Subject: [PATCH 3/3] revert format --- gallery/plot_transforms_v2_e2e.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gallery/plot_transforms_v2_e2e.py b/gallery/plot_transforms_v2_e2e.py index 7339bbbcf41..533a3d5d752 100644 --- a/gallery/plot_transforms_v2_e2e.py +++ b/gallery/plot_transforms_v2_e2e.py @@ -98,7 +98,9 @@ def load_example_coco_detection_dataset(**kwargs): transform = transforms.Compose( [ transforms.RandomPhotometricDistort(), - transforms.RandomZoomOut(fill=defaultdict(lambda: 0, {PIL.Image.Image: (123, 117, 104)})), + transforms.RandomZoomOut( + fill=defaultdict(lambda: 0, {PIL.Image.Image: (123, 117, 104)}) + ), transforms.RandomIoUCrop(), transforms.RandomHorizontalFlip(), transforms.ToImageTensor(),