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

Label names are inconsistently transformed to lowercase #72

Open
leandervaneekelen opened this issue Dec 13, 2024 · 0 comments
Open

Label names are inconsistently transformed to lowercase #72

leandervaneekelen opened this issue Dec 13, 2024 · 0 comments

Comments

@leandervaneekelen
Copy link
Collaborator

Label names in the Label class are transformed to lowercase by default (good design choice imo):

However, there are multiple sampler classes that cross check labels by doing string comparisons, without doing a .lower() operation first, for example:

if annotation.label.name not in self._detection_labels:

This means that this behavior fails silently without any reason:

# Sample at some random coordinate where you expect there to be annotations of Foo
wsa = WholeSlideAnnotation('/path/to/some/file.xml', labels={'Foo': 1})
sampler = DetectionPatchLabelSampler(detection_labels=['Foo'])
annotations = sampler.sample(wsa, (10, 10), (512, 512), 1.0)  

>> annotations = []  # But it's empty because the labels are actually called 'foo' :(

Shall we fix this by just doing .lower by default on labels within all contexts?

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