Skip to content

Commit

Permalink
Revert changes to sort cameras before (de)serializing
Browse files Browse the repository at this point in the history
This problem goes deeper than expected and needs a Pull Request
  • Loading branch information
roomrys authored Oct 4, 2024
1 parent f97e19d commit b55d4ef
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions sleap/io/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,9 +1581,6 @@ def to_session_dict(
# Unstructure `CameraCluster` and `metadata`
calibration_dict = self.camera_cluster.to_calibration_dict()

# Sort `Camcorder`s following same schema as when deserializing
self.camera_cluster.cameras.sort(key=lambda x: x.name)

# Store camcorder-to-video indices map where key is camcorder index
# and value is video index from `Labels.videos`
camcorder_to_video_idx_map = {}
Expand Down Expand Up @@ -1647,9 +1644,6 @@ def from_session_dict(
calibration_dict
)

# Ensure `Camcorder`s are in the same order as they were serialized
session.camera_cluster.cameras.sort(key=lambda x: x.name)

# Retrieve all `Camcorder` and `Video` objects, then add to `RecordingSession`
camcorder_to_video_idx_map = session_dict["camcorder_to_video_idx_map"]
for cam_idx, video_idx in camcorder_to_video_idx_map.items():
Expand Down

0 comments on commit b55d4ef

Please sign in to comment.