Skip to content

FIX: bug in transforms.frame_labels.postprocess, fixes #821#822

Merged
NickleDave merged 5 commits intomainfrom
FIX-transforms-frame-labels-postprocess-bug-#821
Mar 13, 2026
Merged

FIX: bug in transforms.frame_labels.postprocess, fixes #821#822
NickleDave merged 5 commits intomainfrom
FIX-transforms-frame-labels-postprocess-bug-#821

Conversation

@NickleDave
Copy link
Collaborator

No description provided.

Call `np.copy` on `frame_labels` first thing,
so that we don't indirectly mutate any tensor
that shares memory with this numpy array.
Calling this a "cleaning" commit because
it's not really an enhancement.
This just gives us a way to get back the metrics
returned by the LightningModule,
to avoid a bunch of extra work,
like loading them from the csv that gets saved.
It lets me add a regression test for
#821.
There is of course a risk of someone relying
on this "feature", but long-term I will probably
bury this function inside the `cli` package,
so that will hopefully be less likely.
Adds assertions inside
`tests/test_eval/test_frame_classification.py::test_eval_frame_classification`
that check that metric values are not equal
after we apply post-processing transforms to frame labels.

See comment added above assertions:
not sure if this is the best place to test this long term,
but it will work to get a quick fix out.
Rename `assert_eval_output_is_expected` ->
`assert_eval_saves_one_csv`, used in
test_eval/test_frame_classification
and a couple of other places.
@NickleDave NickleDave added BUG Something isn't working Metrics Issue related to metrics labels Mar 13, 2026
@NickleDave NickleDave merged commit 4400f4b into main Mar 13, 2026
1 of 4 checks passed
@NickleDave NickleDave deleted the FIX-transforms-frame-labels-postprocess-bug-#821 branch March 13, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUG Something isn't working Metrics Issue related to metrics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant