| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Fix format_training_data to handle MultiIndex columns with likelihoods: detect coord level, keep only x/y columns (logging when likelihoods are dropped), and raise if x/y are missing. Use the row values to ensure an even number of coordinates after dropping non-coord columns (error if odd), reshape into (N,2), filter NaNs, and clip out-of-image joints. Also skip images without labels.
Add a unit test to tests/test_trainingsetmanipulation.py that verifies format_training_data ignores 'likelihood' columns when formatting training data. The test monkeypatches read_image_shape_fast, constructs a DataFrame with inserted likelihood columns after each y coordinate, and compares the formatted outputs (image, size, joints) against a baseline produced from the original x/y-only DataFrame to ensure identical results.
|
Note: after discussion with @deruyter92, it has been decided not to retain likelihood columns in CollectedData, as previously. See DeepLabCut/napari-deeplabcut#204. |
Sorry, something went wrong.
For future reference we concluded yes for the following reasons:
|
Sorry, something went wrong.
Add helper _drop_likelihood_columns to remove any 'likelihood' coord columns from MultiIndex annotation DataFrames (using 'coords' level if present or the last level otherwise). Use this sanitizer in merge_annotateddatasets and as a final check in format_training_data to avoid concatenated likelihood columns (fixes issues such as napari-deeplabcut #204 and DeepLabCut #3319). Also log when likelihood columns are detected and dropped, tighten x/y coordinate validation, and apply minor formatting cleanups.
Add a unit test (tests/test_trainingsetmanipulation.py) that verifies merge_annotateddatasets removes 'likelihood' columns from single-animal annotation data. The test creates a temporary labeled-data HDF with multiindex columns (x/y/likelihood), runs merge_annotateddatasets with a non-multianimal config, and asserts that the returned DataFrame and the saved HDF/CSV outputs no longer contain 'likelihood' while preserving x/y coordinates.
| Back | FazBrowse Home | New Git URL |
Issue
The latest napari-deeplabcut version retains the likelihood column when refining machine annotations (they are added to the CollectedData h5 if present).
The h5/csv concat & matlab file creation function always assumed only x and y are present, and did not filter out likelihood, leading to dataset creation failure.
Note: this raises in terminal but could cause the GUI to hang instead, as reported in #3319.
Related
Fix
Improves the robustness of the training data formatting by ensuring that any "likelihood" columns present in the input DataFrame are dropped before .mat formatting, and adds a corresponding test to verify this behavior.
Data formatting fixes:
Testing: