Skip to content

Commit e70afec

Browse files
committed
Download ref/scripts on runtime to avoid sphinx gallery issues with these files
1 parent 9f81c0a commit e70afec

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

.jenkins/validate_tutorials_built.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@
5151
"intermediate_source/flask_rest_api_tutorial",
5252
"intermediate_source/text_to_speech_with_torchaudio",
5353
"intermediate_source/tensorboard_profiler_tutorial", # reenable after 2.0 release.
54-
"intermediate_source/engine", # helper file for torchvision_tutorial.py
55-
"intermediate_source/utils", # helper file for torchvision_tutorial.py
56-
"intermediate_source/coco_utils", # helper file for torchvision_tutorial.py
57-
"intermediate_source/coco_eval", # helper file for torchvision_tutorial.py
58-
"intermediate_source/transforms", # helper file for torchvision_tutorial.py
5954
]
6055

6156
def tutorial_source_dirs() -> List[Path]:

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ download:
114114
# and detection reference scripts: engine.py, utils.py ...
115115
wget https://www.cis.upenn.edu/~jshi/ped_html/PennFudanPed.zip -P $(DATADIR)
116116
unzip -o $(DATADIR)/PennFudanPed.zip -d intermediate_source/data/
117-
wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/engine.py -P intermediate_source
118-
wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/utils.py -P intermediate_source
119-
wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/coco_utils.py -P intermediate_source
120-
wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/coco_eval.py -P intermediate_source
121-
wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/transforms.py -P intermediate_source
122117

123118
docs:
124119
make download

intermediate_source/torchvision_tutorial.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,15 @@ def get_model_instance_segmentation(num_classes):
312312
# In ``references/detection/``, we have a number of helper functions to
313313
# simplify training and evaluating detection models. Here, we will use
314314
# ``references/detection/engine.py`` and ``references/detection/utils.py``.
315-
# Just copy everything under ``references/detection`` to your folder and use them here.
316-
#
315+
# Just download everything under ``references/detection`` to your folder and use them here.
316+
# On Linux if you have ``wget``, you can download them using below commands:
317+
318+
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/engine.py")
319+
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/utils.py")
320+
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/coco_utils.py")
321+
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/coco_eval.py")
322+
os.system("wget https://raw.githubusercontent.com/pytorch/vision/main/references/detection/transforms.py")
323+
317324
# Since v0.15.0 torchvision provides `new Transforms API <https://pytorch.org/vision/stable/transforms.html>`_
318325
# to easily write data augmentation pipelines for Object Detection and Segmentation tasks.
319326
#

0 commit comments

Comments
 (0)