i have images with 4-channels that i created by stacking RGB and thermal data. as follow:
i1= Image.open('rgb.png') #rgb image i2 = Image.open('th.png') #thermal image img = np.dstack((i1,i2))
I am working with pytorch to train a model on these images and at some point I have to process them separately. So I have to extract the RGB image and the thermal image. here is what I did:
def forward(self, image): # split data into RGB and INF thermal = image[:,3:] rgb = image[:,:3]
will “thermal” extract the last channel of my 4-channels image and “rgb” will extract the 3 first channels ?