Skip to content

The labelled filter keeps a crop with any annotation and refuses a dataset without labels - #92

Merged
krokicki merged 1 commit into
dataset-filtersfrom
labelled-any
Nov 23, 2026
Merged

krokicki merged 1 commit into
dataset-filtersfrom
labelled-any

Conversation

@krokicki

@krokicki krokicki commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

A definition's labelled filter becomes a switch with no parameter.

  • A crop passes when it holds a nonzero pixel in a label paired with its raw. One point is enough.
  • A raw with no paired label array fails every draw, so a dataset without labels stages nothing under this filter.
  • The definition's line is {name: labelled}, and the page's control is a checkbox, "skip crops without annotation".

Why

The filter used to require a share of annotated pixels (min_fraction) and passed a dataset without labels unread. In a round of a buffer meant to hold annotated crops, with min_fraction: 0.05:

  • 12 datasets with point, trace, box or sparse labels failed, because no crop reached 5%.
  • 25 of the 125 datasets in the pool had no label array at all (their catalog annotations are per image: a class, a count), and their crops passed untested.

Definitions that still name min_fraction

They load: the number is read and ignored, and the spec carries a warning. A round re-reads its pinned definition while it sources, so refusing the key would fail a round that is under way when the worker restarts. The plan rule never carries it, and the page writes the line without it.

Deploying

The harness side is JaneliaSciComp/mia-snippets#307, and the two must go live together: the current harness requires min_fraction, which this worker no longer sends. A rule with filters gets a new plan digest, pinned in both repos' tests.

Not in this PR

The planner does not know that a dataset's binding has no labels, so such a dataset still enters the pool and fails its stage job with no crop passed the filters.

Testing

The definition, plan, page, API and registration tests pass, and lint and typecheck are clean. The full suite was not run.

Stacked on #91.

@StephanPreibisch @jakobtroidl

The filter is a switch with no parameter: a crop passes when it holds a nonzero pixel in
a label paired with its raw, one point being enough, and a raw without a paired label
array fails every draw. A definition's line is `{name: labelled}` and the page's control
is a checkbox. A min_fraction on labelled is read and ignored with a warning, so a round
pinned to a definition that has one still loads; the plan rule never carries it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@krokicki
krokicki added this pull request to stack #75 November 23, 2026 01:23
@krokicki
krokicki merged commit 31995af into main Nov 23, 2026
1 check passed
@krokicki
krokicki deleted the labelled-any branch November 23, 2026 02:50
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

Successfully merging this pull request may close these issues.

1 participant