That part of the code will select the samples that belong to a specific batch. The for loop first loops over the data in train_X in steps of BATCH_SIZE, which means that the variable i holds the first index for each batch in the training dataset. The rest of the samples for the batch are then the ones after that index up to the sample which completes the ...
torch.argmax has an extra argument dim which you can specify such that the maximum value is taken over a specific dimension. If you specify the dimension which represents the number of images it will return an array of indices where each value is for one image. For example:
# 3 images with 5 classes
t = torch.randn(3, 5)
# tensor([[-1.2917, 1....
The combination annotation of target detection and semantic segmentation.
The target detection comes first, and then each pixel is labeled (semantic segmentation).
Compared to the image above, we take the person as the target objection for example:
Semantic segmentation does not distinguish different instances in the same category (...