def __getitem__(self, index):
label = self.labels[index]
frames_array = np.zeros((frames_length, 3, 200, 200), dtype=np.float32)
......
for idx in range(frames_length):
frame = Image.open(path[idx]).convert("RGB")
if self.transform:
frame = self.transform(frame)
frame = frame.numpy()
frames_array[idx, :, :, :] = frame
......
frames_array = frames_array.transpose((1, 0, 2, 3))
label = torch.tensor(label)
frames = torch.tensor(frames_array)
return frames, label