Skip to content

assert about min_segment_length in format_data #191

@Wenping-Cui

Description

@Wenping-Cui
Y, mask, metadata = batch(coordinates, seg_length=seg_length, keys=keys)
Y = Y.astype(float)
min_segment_length = np.diff(metadata[1], axis=1).min()
assert min_segment_length >= 4, ( f"The shortest segment has length  {min_segment_length} which is below the "
 "minimum of 4. Try increasing `seg_length` in the config (e.g. add "f"{min_segment_length} to its current value) and also make sure that all your ""input recordings are at least 4 frames long." )

jax_moseq.utils.batch would break up the data into fixed length segments. I found that it would report error when the number of frames happens to be seg_length+num<4. I would suggest to modify format_data to prune and filter out the short sequences within some threshold instead of reporting an error when min_segment_length<4 with assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions