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

Fix Classifier loading #77

Open
tpietzsch opened this issue Nov 8, 2021 · 0 comments
Open

Fix Classifier loading #77

tpietzsch opened this issue Nov 8, 2021 · 0 comments

Comments

@tpietzsch
Copy link
Collaborator

The UI for loading classifiers is a bit broken.

Ideally, I think, the following behaviour would be desirable:

  • If "Segmentation > Open Classifier ..." is executed, a new Segmentation item is created, the selected classifier file is loaded into this item, and the new item is selected and run for the opened image.

The current behaviour is:

  • If no existing Segmentation item is selected, "Segmentation > Open Classifier ..." results in an exception.
  • If an existing Segmentation item is selected, "Segmentation > Open Classifier ..." will load the classifier file into that item, if the selected item is of the correct type. Otherwise, an exception might be thrown, or it might just silently fail. It may seem like the loading was successful, but actually nothing happened.

Some problems are:

  • Items in the Segmentation list cannot change their type. (The user has to know which type the saved classifier is, create a Segmentation item of the matching type, then select it, and load it).
  • The .classifier JSON has no indication of which type of Segmenter it represents, making it difficult to do the right thing.

It is probably not too late to change the classifier file format to add information about the Segmenter type (ideally not a class name, but some string representation that can also be matched later, should the package structure change etc...). Very likely, all already existing .classifier files refer to TrainableSegmentationSegmenter, so that would be the natural fallback, if the Segmenter type is missing. This wouldn't break existing .classifier files, and at the same time provide an extensible way forward.

I would do that, and modify "Segmentation > Open Classifier ..." to always add a new Segmenter item, circumventing the problem that Segmentation items would have to be able to change type if "Open Classifier ..." would load into the selected (if any) item.

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