You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Replace Albumentations with torchvision.transforms.v2 for PyTorch pose estimation #3240
Is your feature request related to a problem? Please describe.
Albumentations is an external dependency that has slowed down its development (last major release 1.4.3 in late 2023).
Describe the solution you'd like
Replace the current Albumentations-based augmentation system in the PyTorch pose estimation module (deeplabcut/pose_estimation_pytorch/data/transforms.py) with torchvision.transforms.v2.
Benefits:
Dependency reduction: Fewer external dependencies
Active development: torchvision.transforms.v2 is actively maintained
Better integration: Native support for tv_tensors.KeyPoints, tv_tensors.BoundingBoxes
Performance: Optimized for PyTorch with potential GPU acceleration
Describe alternatives you've considered
Keep Albumentations: Continue using it, but this relies on an external library with slower development
Kornia: Another option for differentiable augmentations, but less focused on standard image transforms
Custom implementation: Implement all transforms from scratch (too much work)
Additional context
Current implementation uses ~15+ Albumentations transforms:
I'd like to contribute to developing this feature but have some questions about the desired interface:
Custom transforms vs. built-ins: Should we implement custom DLC-specific transforms (e.g., KeypointAwareCrop for cropping around annotated keypoints) using PyTorch, or adapt to use built-in v2 transforms?
API compatibility: Should the config format remain the same (e.g., hflip, affine, crop_sampling), or take advantage of v2's declarative API?
Backward compatibility: Should we maintain Albumentations as a fallback, or fully migrate to v2?
Hello @juan-cobos, thanks for the detailed request.
This has been discussed mostly between maintainers so far, I will make sure to bring this to attention internally and try to provide more specific guidelines.
To add more context, there is also AlbumentationsX and #3174 provides the first steps of migrating to it.
I personally agree that relying on external packages for augmentations may not be ideal, but ultimately this will require consensus to proceed.
Activity
C-Achard commentedon Mar 13, 2026
Hello @juan-cobos, thanks for the detailed request.
This has been discussed mostly between maintainers so far, I will make sure to bring this to attention internally and try to provide more specific guidelines.
To add more context, there is also AlbumentationsX and #3174 provides the first steps of migrating to it.
I personally agree that relying on external packages for augmentations may not be ideal, but ultimately this will require consensus to proceed.