Stop passing classes and default_classes to export and evaluation methods #1858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1722.
This is scratching a pretty deep itch, and it feels oh so good 🥇
The fact that certain API methods would silently search for class lists on
Dataset.classes
andDataset.default_classes
often caused unexpected behavior for users that had first used something likefilter_labels()
to select a subset of classes to work with (see #1722 for details).Lesson learned: don't be fancy, let the user store class lists, but prefer relying on the user to explicitly request certain behavior:
NOTE: there's still one important place that will silently infer class lists: the annotation API. My reasoning there is, even if the user first did something likefilter_labels()
to extract a view of interest to annotate, they are very likely to want all possible classes from their schema available for use when annotating.^removed default classes/mask targets from the annotation API too