I want to fine tune the pre-trained fcn resnet segmentation model with my own data set which only contains two classes.
I am following this tutorial 53, but I want to understand how the code knows which 2 classes I am referring to? So lets say my custom data set contains images with only two classes, background and car for example, when I set num_classes = 2, how does the code know that I’m specifically referring to background and car, instead of any of the other 20 classes it was originally trained on like cat, dog, horse, bicycle, etc?
Can it just tell by the specific color in the masked images? Or does it have to be specified somewhere in the code when fine tuning?
I am new to pytorch and machine learning so I would like to gain a better understanding of this so I can finetune the fcn resnet model correctly.