Skip to content

Commit

Permalink
Bump to 0.0.11 (#66)
Browse files Browse the repository at this point in the history
* Bump version

* Add new example to readme
  • Loading branch information
talmo authored Sep 12, 2023
1 parent d4aa283 commit e475a47
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ labels = sio.load_slp("predictions.slp")
sio.save_nwb(labels, "predictions.nwb")
```

### Convert labels to raw arrays

```py
import sleap_io as sio

labels = sio.load_slp("tests/data/slp/centered_pair_predictions.slp")

# Convert predictions to point coordinates in a single array.
trx = labels.numpy()
n_frames, n_tracks, n_nodes, xy = trx.shape
assert xy == 2

# Convert to array with confidence scores appended.
trx_with_scores = labels.numpy(return_confidence=True)
n_frames, n_tracks, n_nodes, xy_score = trx.shape
assert xy_score == 3
```

### Create labels from raw data

```py
Expand Down
2 changes: 1 addition & 1 deletion sleap_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Define package version.
# This is read dynamically by setuptools in pyproject.toml to determine the release version.
__version__ = "0.0.10"
__version__ = "0.0.11"

from sleap_io.model.skeleton import Node, Edge, Skeleton, Symmetry
from sleap_io.model.video import Video
Expand Down

0 comments on commit e475a47

Please sign in to comment.