Skip to content

RandomHorizontalFlip - masks classes should also be flipped #82

Description

@dahliau

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] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions