This example shows the inference of an already trained model. This model does not require training from scratch.
But you can finetune it. To do this, you can freeze the weights of the first layers of the neural network and train the remaining ones on a set of images. In this case, only unfrozen weights will be trained. You can read about finetuning here: https://docs.pytorch.org/tutorials/intermediate/torchvision_tutorial.html.