Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deeplabcut/pose_estimation_pytorch/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _prepare_final_annotation_dict(

# we use ..., :3 to pass the visibility flag along
return {
"keypoints": pad_to_length(keypoints[..., :3], num_animals, -1).astype(
"keypoints": pad_to_length(keypoints[..., :3], num_animals, 0).astype(
np.single
),
"keypoints_unique": keypoints_unique[..., :3].astype(np.single),
Expand Down
6 changes: 4 additions & 2 deletions deeplabcut/pose_estimation_pytorch/data/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def build_transforms(augmentations: dict) -> A.BaseCompose:
if rotation is not None:
rotation = (-rotation, rotation)
if translation is not None:
translation = (0, translation)
translation = (-translation, translation)

transforms.append(
A.Affine(
Expand Down Expand Up @@ -281,6 +281,8 @@ def get_params_dependent_on_targets(self, params: dict[str, Any]) -> dict[str, A
sampling = self.crop_sampling
if self.crop_sampling == "hybrid":
sampling = np.random.choice(["uniform", "density"])
if len(kpts) == 0:
sampling = "uniform"
if sampling == "uniform":
center = np.random.random(2)
else:
Expand Down Expand Up @@ -310,7 +312,7 @@ def apply_to_keypoints(
self,
keypoints,
**params,
) -> list[float]:
) -> list[tuple[float]]:
keypoints = super().apply_to_keypoints(keypoints, **params)
new_keypoints = []
for kp in keypoints:
Expand Down