sleap_analysis
sleap.io.format.sleap_analysis
¶
Adaptor to read and write analysis HDF5 files.
These contain location and track data, but lack other metadata included in a full SLEAP dataset file.
This adaptor uses sleap-io for both reading and writing analysis HDF5 files, providing a consistent format with additional metadata like dimension labels and skeleton symmetries.
To determine whether this adaptor can read a file, we check it's an HDF5 file
with a track_occupancy dataset.
Classes:
| Name | Description |
|---|---|
SleapAnalysisAdaptor |
|
SleapAnalysisAdaptor
¶
Bases: Adaptor
Methods:
| Name | Description |
|---|---|
read |
Reads analysis HDF5 file using sleap-io. |
write |
Writes analysis file for |
Source code in sleap/io/format/sleap_analysis.py
read(file, video, *args, **kwargs)
classmethod
¶
Reads analysis HDF5 file using sleap-io.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
FileHandle
|
The file handle for the HDF5 file. |
required |
video
|
Union[Video, str]
|
The video to associate with the data. Can be a Video object or a path string. |
required |
Returns:
| Type | Description |
|---|---|
Labels
|
Labels object with loaded pose data. |
Source code in sleap/io/format/sleap_analysis.py
write(filename, source_object, source_path=None, video=None)
classmethod
¶
Writes analysis file for class:
Labels source_object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The filename for the output file. |
required |
source_object
|
Labels
|
The |
required |
source_path
|
str
|
Path to the source labels file (stored as metadata). |
None
|
video
|
Video
|
The |
None
|