Skip to content

Commit

Permalink
feat: update SLEAP ingestion - no longer dependent on config_file
Browse files Browse the repository at this point in the history
  • Loading branch information
ttngu207 committed Jul 16, 2024
1 parent 9299ed4 commit 96e9e46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions aeon/dj_pipeline/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,8 @@ def make(self, key):
if not len(pose_data):
raise ValueError(f"No SLEAP data found for {key['experiment_name']} - {device_name}")

# get bodyparts and classes
bodyparts = stream_reader.get_bodyparts()
anchor_part = bodyparts[0] # anchor_part is always the first one
class_names = stream_reader.get_class_names()
# get identity names
class_names = np.unique(pose_data.identity)
identity_mapping = {n: i for i, n in enumerate(class_names)}

# ingest parts and classes
Expand All @@ -186,6 +184,10 @@ def make(self, key):
identity_position = pose_data[pose_data["identity"] == identity]
if identity_position.empty:
continue

# get anchor part - always the first one of all the body parts
anchor_part = np.unique(identity_position.part)[0]

for part in set(identity_position.part.values):
part_position = identity_position[identity_position.part == part]
part_entries.append(
Expand Down

0 comments on commit 96e9e46

Please sign in to comment.