Skip to content

Commit f0ab3de

Browse files
committed
Specified Python code blocks.
1 parent 6d42dda commit f0ab3de

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

intermediate_source/torchvision_tutorial.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ So each image has a corresponding
9797
segmentation mask, where each color correspond to a different instance.
9898
Let’s write a ``torch.utils.data.Dataset`` class for this dataset.
9999

100-
::
100+
.. code:: python
101101
102102
import os
103103
import numpy as np
@@ -208,7 +208,7 @@ Let’s suppose that you want to start from a model pre-trained on COCO
208208
and want to finetune it for your particular classes. Here is a possible
209209
way of doing it:
210210

211-
::
211+
.. code:: python
212212
213213
import torchvision
214214
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
@@ -227,7 +227,7 @@ way of doing it:
227227
2 - Modifying the model to add a different backbone
228228
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
229229

230-
::
230+
.. code:: python
231231
232232
import torchvision
233233
from torchvision.models.detection import FasterRCNN
@@ -275,7 +275,7 @@ our dataset is very small, so we will be following approach number 1.
275275
Here we want to also compute the instance segmentation masks, so we will
276276
be using Mask R-CNN:
277277

278-
::
278+
.. code:: python
279279
280280
import torchvision
281281
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
@@ -316,7 +316,7 @@ folder and use them here.
316316
Let’s write some helper functions for data augmentation /
317317
transformation:
318318

319-
::
319+
.. code:: python
320320
321321
import transforms as T
322322
@@ -330,7 +330,7 @@ transformation:
330330
Let’s now write the main function which performs the training and the
331331
validation:
332332

333-
::
333+
.. code:: python
334334
335335
from engine import train_one_epoch, evaluate
336336
import utils

0 commit comments

Comments
 (0)