Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A question aboue the function "randomflip(self, buffer)" #65

Open
YuQi9797 opened this issue Oct 25, 2021 · 0 comments
Open

A question aboue the function "randomflip(self, buffer)" #65

YuQi9797 opened this issue Oct 25, 2021 · 0 comments

Comments

@YuQi9797
Copy link

https://github.com/jfzhang95/pytorch-video-recognition/blob/master/dataloaders/dataset.py#L198

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

Flip the frame horizontally first, but flip the frame horizontally again in the buffer[i]. Wouldn't that have no effect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant