core.py
PoseGroup
¶
Bases: SpyglassMixin
, Manual
Groups one or more entries of keypoint pose information
Source code in src/spyglass/behavior/v1/core.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
create_group(group_name, merge_ids, bodyparts=None)
¶
Create a group of pose information
Parameters:
Name | Type | Description | Default |
---|---|---|---|
group_name
|
str
|
Name of the group |
required |
keys
|
List[dict]
|
list of keys from PositionOutput to include in the group |
required |
bodyparts
|
List[str]
|
body parts to include in the group, by default None includes all from every set |
None
|
Source code in src/spyglass/behavior/v1/core.py
fetch_pose_datasets(key=None, format_for_moseq=False)
¶
fetch pose information for a group of videos
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
dict
|
group key |
None
|
format_for_moseq
|
bool
|
format for MoSeq, by default False |
False
|
Returns:
Type | Description |
---|---|
dict
|
dictionary of video name to pose dataset |
Source code in src/spyglass/behavior/v1/core.py
fetch_video_paths(key=None)
¶
fetch video paths for a group of videos
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
dict
|
group key |
None
|
Returns:
Type | Description |
---|---|
List[Path]
|
list of video paths |
Source code in src/spyglass/behavior/v1/core.py
format_dataset_for_moseq(datasets, bodyparts, coordinate_axes=['x', 'y'])
¶
format pose datasets for MoSeq
Parameters:
Name | Type | Description | Default |
---|---|---|---|
datasets
|
dict[str, DataFrame]
|
dictionary of video name to pose dataset |
required |
bodyparts
|
List[str]
|
list of body parts to include in the pose |
required |
coordinate_axes
|
List[str]
|
list of coordinate axes to include, by default ["x", "y"] |
['x', 'y']
|
Returns:
Type | Description |
---|---|
tuple[dict[str, np.ndarray], dict[str, np.ndarray]
|
coordinates and confidences for each video |