FIX: bug in transforms.frame_labels.postprocess, fixes #821#822
Merged
NickleDave merged 5 commits intomainfrom Mar 13, 2026
Merged
FIX: bug in transforms.frame_labels.postprocess, fixes #821#822NickleDave merged 5 commits intomainfrom
transforms.frame_labels.postprocess, fixes #821#822NickleDave merged 5 commits intomainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.