sleap.nn.data.general

General purpose transformers for common pipeline processing tasks.

class sleap.nn.data.general.KeyDeviceMover(keys: List[str] = NOTHING)[source]

Transformer for moving example keys to cpu.

property input_keys

Return the keys that incoming elements are expected to have.

property output_keys

Return the keys that outgoing elements will have.

transform_dataset(input_ds: tensorflow.python.data.ops.dataset_ops.DatasetV2) → tensorflow.python.data.ops.dataset_ops.DatasetV2[source]

Create a dataset that contains data but moved to cpu.

class sleap.nn.data.general.KeyFilter(keep_keys: List[str] = NOTHING)[source]

Transformer for filtering example keys.

property input_keys

Return the keys that incoming elements are expected to have.

property output_keys

Return the keys that outgoing elements will have.

transform_dataset(input_ds: tensorflow.python.data.ops.dataset_ops.DatasetV2) → tensorflow.python.data.ops.dataset_ops.DatasetV2[source]

Create a dataset that contains filtered data.

class sleap.nn.data.general.KeyRenamer(old_key_names: List[str] = NOTHING, new_key_names: List[str] = NOTHING, drop_old: bool = True)[source]

Transformer for renaming example keys.

property input_keys

Return the keys that incoming elements are expected to have.

property output_keys

Return the keys that outgoing elements will have.

transform_dataset(input_ds: tensorflow.python.data.ops.dataset_ops.DatasetV2) → tensorflow.python.data.ops.dataset_ops.DatasetV2[source]

Create a dataset that contains filtered data.