Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Fast image augmentation library (Albumentations). 70+ transforms for classification, segmentation, object detection, keypoints, and pose estimation. Optimized OpenCV-based pipeline with unified API across all CV tasks. Supports images, masks, bounding boxes, and keypoints simultaneously. Note: classic Albumentations (MIT) is no longer maintained; successor AlbumentationsX uses AGPL-3.0. For torchvision-native augmentations, use torchvision.transforms.v2.
.claude/skills/mkurman-albumentations/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 251% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -38% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 11% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 396% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 299% | 0% |
----|---------------|----------| | Pixel-level | BrightnessContrast, Gamma, HueSaturationValue, CLAHE, Blur, GaussNoise, ISONoise, RGBShift, ChannelShuffle, ToGray, Solarize, Posterize, Equalize, ColorJitter | Color/lighting variation | | Spatial-level | RandomCrop, CenterCrop, Resize, Rotate, Flip, ShiftScaleRotate, Affine, ElasticTransform, GridDistortion, OpticalDistortion, Perspective, PiecewiseAffine | Geometric variation | | Weather | RandomRain, RandomSnow, RandomFog, RandomSunFlare | Adverse conditions | | Advanced | CoarseDropout, Cutout, MixUp, Mosaic | Regularization, domain gap | | Special | CLAHE, Emboss, Sharpen, Superpixels, FDA, HistogramMatching, PixelDistributionAdaptation | Medical, domain adaptation |
python# OneOf: apply exactly one transform from a list transform = A.Compose([ A.OneOf([ A.RandomBrightnessContrast(p=1.0), A.RandomGamma(p=1.0), A.HueSaturationValue(p=1.0), ], p=0.8), A.HorizontalFlip(p=0.5), ]) # SomeOf: apply up to N transforms from a list transform = A.Compose([ A.SomeOf([ A.GaussNoise(p=1.0), A.ISONoise(p=1.0), A.MultiplicativeNoise(p=1.0), ], n=2, replace=False, p=0.5), ]) # Per-transform probability transform = A.Compose([ A.RandomCrop(256, 256, p=1.0), # Always applied A.HorizontalFlip(p=0.5), # 50% chance A.RandomBrightnessContrast(p=0.2), # 20% chance ])
python# Supported formats: # pascal_voc: [x_min, y_min, x_max, y_max] (pixels) # albumentations: normalized [x_center, y_center, width, height] # coco: [x_min, y_min, width, height] (pixels) # yolo: normalized [x_center, y_center, width, height] transform = A.Compose([ A.HorizontalFlip(p=0.5), ], bbox_params=A.BboxParams( format="coco", min_visibility=0.3, # Drop bboxes <30% visible after transform label_fields=["class_labels", "class_ids"], # Extra fields to transform ))
Apply identical augmentation parameters to multiple images:
pythontransform = A.Compose([ A.RandomCrop(256, 256), A.HorizontalFlip(p=0.5), A.RandomBrightnessContrast(p=0.5), ]) # Apply to first image, get replay params data = transform(image=image1, mask=mask1) replay_params = data["replay"] # Reapply IDENTICAL transforms to second image data2 = A.ReplayCompose.replay(replay_params, image=image2, mask=mask2)
pythonimport albumentations as A transform = A.Compose([ A.RandomCrop(256, 256), A.HorizontalFlip(p=0.5), A.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), ]) # Save to YAML/JSON A.save(transform, "augmentation_pipeline.yaml") A.save(transform, "augmentation_pipeline.json") # Load back loaded = A.load("augmentation_pipeline.yaml")
pythonimport albumentations as A from albumentations.pytorch import ToTensorV2 train_transform = A.Compose([ A.RandomResizedCrop(224, 224), A.HorizontalFlip(p=0.5), A.ColorJitter(brightness=0.2, contrast=0.2, p=0.5), A.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), ToTensorV2(), # Convert HWC numpy → CHW tensor ]) val_transform = A.Compose([ A.Resize(256, 256), A.CenterCrop(224, 224), A.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), ToTensorV2(), ]) # In PyTorch Dataset: class MyDataset(Dataset): def __getitem__(self, idx): image = cv2.imread(self.images[idx]) image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) if self.transform: augmented = self.transform(image=image) image = augmented["image"] return image, self.labels[idx]
MixUp (alpha blending two images):
pythontransform = A.Compose([ A.MixUp(reference_data=reference_dataset, alpha=0.4, p=0.5), A.HorizontalFlip(p=0.5), ])
CoarseDropout (Cutout regularization):
pythontransform = A.Compose([ A.CoarseDropout(max_holes=8, max_height=32, max_width=32, p=0.5), ])
FDA (Fourier Domain Adaptation):
python# Swap low-frequency components between source and target domain images transform = A.Compose([ A.FDA(reference_images=target_domain_images, beta_limit=0.1, p=0.5), ])
A.Compose with probabilities to control augmentation strengthOneOf for mutually exclusive transforms (e.g., pick one blur method)ToTensorV2() for seamless PyTorch conversion| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 4,960 | 4,930 | -1% | 1 | 1 | 0% | 784 | 2,754 | +251% | 0 | 0 | — |
case-02 | pass→pass | 18,809 | 10,401 | -45% | 1 | 1 | 0% | 3,340 | 3,707 | +11% | 0 | 0 | — |
case-03 | pass→pass | 2,788 | 4,139 | +48% | 1 | 1 | 0% | 507 | 2,516 | +396% | 0 | 0 | — |
case-04 | pass→pass | 3,508 | 3,703 | +6% | 1 | 1 | 0% | 626 | 2,500 | +299% | 0 | 0 | — |
case-05 | pass→pass | 7,938 | 4,657 | -41% | 1 | 1 | 0% | 487 | 2,595 | +433% | 0 | 0 | — |
case-06 | pass→pass | 7,093 | 6,521 | -8% | 1 | 1 | 0% | 1,236 | 2,891 | +134% | 0 | 0 | — |
case-07 | pass→pass | 9,013 | 7,107 | -21% | 1 | 1 | 0% | 1,708 | 3,172 | +86% | 0 | 0 | — |
case-08 | pass→pass | 10,666 | 7,896 | -26% | 1 | 1 | 0% | 1,789 | 3,198 | +79% | 0 | 0 | — |
case-09 | pass→pass | 3,075 | 2,246 | -27% | 1 | 1 | 0% | 446 | 2,198 | +393% | 0 | 0 | — |
case-10 | pass→pass | 5,134 | 3,991 | -22% | 1 | 1 | 0% | 892 | 2,545 | +185% | 0 | 0 | — |
case-11 | pass→pass | 3,849 | 2,574 | -33% | 1 | 1 | 0% | 626 | 2,181 | +248% | 0 | 0 | — |
case-12 | pass→pass | 8,148 | 5,052 | -38% | 1 | 1 | 0% | 1,521 | 2,739 | +80% | 0 | 0 | — |
case-13 | pass→pass | 4,435 | 2,244 | -49% | 1 | 1 | 0% | 745 | 2,141 | +187% | 0 | 0 | — |
case-14 | pass→pass | 8,706 | 5,982 | -31% | 1 | 1 | 0% | 1,609 | 2,796 | +74% | 0 | 0 | — |
case-15 | pass→pass | 9,757 | 9,326 | -4% | 1 | 1 | 0% | 1,820 | 3,614 | +99% | 0 | 0 | — |
case-16 | fail→fail | 8,399 | 5,108 | -39% | 1 | 1 | 0% | 1,276 | 2,742 | +115% | 0 | 0 | — |
case-17 | pass→pass | 4,027 | 3,660 | -9% | 1 | 1 | 0% | 625 | 2,363 | +278% | 0 | 0 | — |
case-18 | pass→pass | 9,531 | 6,866 | -28% | 1 | 1 | 0% | 1,898 | 3,138 | +65% | 0 | 0 | — |
case-19 | fail→pass | 19,673 | 1,686 | -91% | 1 | 1 | 0% | 3,265 | 2,032 | -38% | 0 | 0 | — |
case-20 | pass→pass | 8,250 | 9,987 | +21% | 1 | 1 | 0% | 1,604 | 3,634 | +127% | 0 | 0 | — |
case-21 | pass→pass | 11,317 | 9,381 | -17% | 1 | 1 | 0% | 2,098 | 3,512 | +67% | 0 | 0 | — |
case-22 | pass→pass | 15,593 | 18,933 | +21% | 1 | 1 | 0% | 2,807 | 5,288 | +88% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.