Output .h5 files only show one instance where GUI shows many #2447
Unanswered
anaeguiguren
asked this question in
Help!
Replies: 1 comment
-
|
Hello, This looks ok to me. It looks like the shape of your locations (instances, nodes, x-y, score). Can you export this as a CSV and let us know if it doesn't give you what you were looking for? Thanks! Elizabeth |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I am seeking to analyze my manual labels from a SLEAP project (v1.5.1). For this, I exported analyses as HDF5 with the user interface. Next, I opened a Jupyter notebook and ran the code below to inspect the file contents. However, when I inspect the .h5 file, they read only a single instance (see output below) in a frame where I marked 48individuals (which do show up in the GUI). I'm mainly looking for a way to extract positions from all the instances across all frames, but I'm not sure how to fix this? Thanks so much in advance for your time, and sorry if this is a very basic question!
**with h5py.File(filename, "r") as f:
dset_names = list(f.keys())
locations = f["tracks"][:].T
node_names = [n.decode() for n in f["node_names"][:]]
print("===filename===")
print(filename)
print()
print("===HDF5 datasets===")
print(dset_names)
print()
print("===locations data shape===")
print(locations.shape)
print()
print("===nodes===")
for i, name in enumerate(node_names):
print(f"{i}: {name}")
print()**
_===filename===
SLEAP_outputs/InterSpecies_Interactions_Formations_v1.5_proofread.000_Gal2023_DJIMini2_20230217_083958.analysis.h5
===HDF5 datasets===
['edge_inds', 'edge_names', 'instance_scores', 'labels_path', 'node_names', 'point_scores', 'provenance', 'track_names', 'track_occupancy', 'tracking_scores', 'tracks', 'video_ind', 'video_path']
===locations data shape===
(16424, 3, 2, 1)
===nodes===
0: snout
1: dorsal
2: fluke_
Beta Was this translation helpful? Give feedback.
All reactions