Repository navigation
Conversation
211a390 to
d15f840
Compare
deruyter92
left a comment
There was a problem hiding this comment.
Looks great. A few high-level remarks that we may need to discuss first:
- I think your
LabeledDatalooks great a a new canonical long-format standard that we can use internally. I agree with the df as primary format with theto_arrayview that makes it available for training (or napari operations). - I think it would be useful to incorporate a single explicit
LabeledDataLayoutmodel that can be passed as context object next to the array view as handover to the training code, or anywhere else where arrays are used. I'd suggest a Pydantic model for this, which makes the validation easier. - As a final goal, my preference would go to a thinner public API that just offers this canonical
LabeledData+ read + write helpers. I love to hear your opinion on the feasibility of that. The elaborate wide format model and other public types in my view are mostly super important for the validation of current (legacy) formats that remain supported, but if possible, we can prevent downstream packages to deal with this kind of validation, and only keep that part private for dlccore. e.g.LabeledDataHeader,LabeledDataRowIndex, etc..
Let's discuss in more detail
4c491bb to
9286560
Compare
e83c3cc to
5777096
Compare
- Rename the package to dlccore.io and add the dlccore license header - Remove LabeledData.from_wide_df until the wide-to-long conversion it calls is added - Name DataFrames `df`, never `frame`: LabeledData._frame becomes _df - State in the docstrings that a format behind an optional extra is converted by free functions in its own module, not LabeledData methods - Reword the LabeledDataArrays summary and note 3D support and NPZ export as TODO
5777096 to
358276c
Compare
I fully agree, I've made it private in #41 where I could, sorry, I indeed could have spent more time thinking about visibility, but the goal is an easy API, and hiding any complexity from consumers as relevant. See the new PR. |
Also agree, though if it's okay I'd make annotation the first consumer rather than training? I'll open a new PR with a first proposal. Then I'll work on outputs and frame/time indexed pose (Mostly because I feel the napari-dlc duplication is the main gain from this) |
LabeledData: one long table, one row per frame and keypoint, that every format converts to and from. It checks columns, dtypes, density and identities when built, and converts to the wide DataFrame and to arrays.individualcolumn, as DeepLabCut's three-level header has none.Its methods only convert to forms that need nothing beyond core dependencies.