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

Enhance deepedit transforms to do label check #7225

Closed
yiheng-wang-nv opened this issue Nov 13, 2023 · 3 comments
Closed

Enhance deepedit transforms to do label check #7225

yiheng-wang-nv opened this issue Nov 13, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@yiheng-wang-nv
Copy link
Contributor

Errors should be raises if input wrong label_names

cc @diazandr3s @Nic-Ma

@diazandr3s
Copy link
Contributor

Errors should be raises if input wrong label_names

cc @diazandr3s @Nic-Ma

Hi @yiheng-wang-nv,

This is a good point. One thing we could do is to use .lower() for the label names.
However, a minimum typo in the label name would be recognised as a completely different label.
Maybe with regular expressions?

@KumoLiu KumoLiu added the enhancement New feature or request label Nov 14, 2023
@yiheng-wang-nv
Copy link
Contributor Author

Hi @diazandr3s , thanks for the suggestion. I think for the first version, we can simply add .lower() only. I will submit a PR soon.

@yiheng-wang-nv
Copy link
Contributor Author

I rethink about this requirements, the current logic is like:

# Creating guidance for all clicks
all_guidances = {}
for key_label in self.label_names.keys():
clicks = d.get(key_label, [])
clicks = list(np.array(clicks).astype(int))
all_guidances[key_label] = self._apply(clicks, factor)
d[self.guidance] = all_guidances

in the transform level, it may not be able to check input data keys. For example, if the input data and label names are like:

data = {'image': image_id, 'spleen': [[1, 2, 3,], [1, 2, 2]], 'bounding_box': [[2, 3], [4, 5]}
label_names = {
        "spleen": 1,
        "background": 0
    }

We cannot consider bounding_box as an error, since it may be used for other purpose, such as for the next transform or for loss calculation, ...

HI @diazandr3s , what do you think? Maybe we can close this issue right now

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

No branches or pull requests

3 participants