pytorch-video-recognition
pytorch-video-recognition copied to clipboard
Is random flip accomplished only in testing set?
According to following lines of code from dataset.py, it seems like random flip is triggered only for testing data. https://github.com/jfzhang95/pytorch-video-recognition/blob/a63b85f351be193159eaad011115973bb99b9745/dataloaders/dataset.py#L81-L83
Do I get it wrong, or this is a bug where 'test' should be changed by 'train'?
@wave-transmitter It seems like a typo error, it should be on training process. And I think the function randomflip
has a bug, in the for
loop, it calls cv2.flip
two times, it should call only once.
def randomflip(self, buffer):
"""Horizontally flip the given image and ground truth randomly with a probability of 0.5."""
if np.random.random() < 0.5:
for i, frame in enumerate(buffer):
frame = cv2.flip(buffer[i], flipCode=1)
buffer[i] = cv2.flip(frame, flipCode=1)
return buffer
II think so too After two cv2.flip(...), the picture has no change.