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

Is random flip accomplished only in testing set? #15

Open
wave-transmitter opened this issue Feb 5, 2019 · 2 comments
Open

Is random flip accomplished only in testing set? #15

wave-transmitter opened this issue Feb 5, 2019 · 2 comments

Comments

@wave-transmitter
Copy link

According to following lines of code from dataset.py, it seems like random flip is triggered only for testing data.

if self.split == 'test':
# Perform data augmentation
buffer = self.randomflip(buffer)

Do I get it wrong, or this is a bug where 'test' should be changed by 'train'?

@leftthomas
Copy link

leftthomas commented Apr 5, 2019

@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

@Taylor-X76
Copy link

II think so too
After two cv2.flip(...), the picture has no change.

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

3 participants