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

RandomHorizontalFlip - masks classes should also be flipped #82

Open
dahliau opened this issue May 24, 2023 · 0 comments
Open

RandomHorizontalFlip - masks classes should also be flipped #82

dahliau opened this issue May 24, 2023 · 0 comments

Comments

@dahliau
Copy link

dahliau commented May 24, 2023

Hey,
Thank you very much for this repo. I found it very informative and easy to try!

I noticed an issue in the RandomHorizontalFlip transform.
For the networks which perform classification the order of the lanes does matter (right to left, or left to right).
And the following fix can improve the results for these networks (e.g resa34).

https://github.com/Turoad/lanedet/blob/35665fc9dd8d80df207fa86d2152f9f48618ffe7/lanedet/datasets/process/transforms.py#LL258C1-L259C1

        if 'mask' in sample:
            sample['mask'] = np.fliplr(sample['mask'])
            zeros = sample['mask']==0
            sample['mask'][~zeros] = (1+6)-sample['mask'][~zeros] 
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