بنقرة واحدة
review-transform
// Run the full shared Codex review checklist against a transform. Use when the user asks to review, audit, or check a transform for correctness, performance, or API consistency.
// Run the full shared Codex review checklist against a transform. Use when the user asks to review, audit, or check a transform for correctness, performance, or API consistency.
Full checklist for adding a new transform to AlbumentationsX. Use when the user asks to add, implement, or create a new transform/augmentation.
Run performance benchmarks for transform changes. Use when the user asks to benchmark, measure performance, compare speed, or when changes affect apply methods, functional layer, get_params, or core pipeline code.
Quality bar for docstrings in albumentations. Use when writing or updating docstrings in albumentations/, especially for transforms and public APIs.
Use the repo `_internal/` directory for anything that must not be committed — scratch files, temporary outputs, local demos, Codex artifacts, or one-off scripts. Use when creating temp files, debug dumps, or local-only tooling during a task.
Policy for AlbumentationsX transforms that combine multiple images or objects. Use when implementing, reviewing, or using Mosaic, CopyAndPaste, OverlayElements, HistogramMatching, PixelDistributionAdaptation, or other mixing transforms.
Generate release notes for AlbumentationsX. Use when the user asks to prepare, draft, or write release notes for a new version (e.g. "prepare release notes for 2.x.y", "draft release X").
| name | review-transform |
| description | Run the full shared Codex review checklist against a transform. Use when the user asks to review, audit, or check a transform for correctness, performance, or API consistency. |
Run these checks in order. Report issues with severity: 🔴 Critical, 🟡 Important, 🟢 Suggestion.
if False:, conditions that can never be true)(H,W,C), (N,H,W,C), (D,H,W,C), (N,D,H,W,C)), and grayscale is (H,W,1).BboxParams.bbox_typecv2.minAreaRect output; use cv2.boxPoints then polygons_to_obb_range suffix: brightness_range, not brightness_limitfill not fill_value, fill_mask not fill_mask_valueborder_mode not mode or pad_modeInitSchema (except Pydantic discriminator fields)apply_* method args (other than self, **params)InitSchema fields use Annotated[...] validators where applicableget_transform_init_args_names() override — the base class auto-detects from __init__ via MROget_params or get_params_dependent_on_data, NOT in apply_*self.py_random for simple ops (faster)self.random_generator only when numpy arrays are needednp.random.* or random.* module-level calls anywhere in the classImageType used for image/mask/volume params and return types (not np.ndarray)np.ndarray used for bboxes and keypoints onlyPriority order to check:
cv2.LUT used for pixel lookup operations (fastest)albucore.resize not cv2.resize for image resizing (handles 5+ channels, INTER_AREA, etc.)cv2 over numpy for image ops where applicable.copy())get_params / get_params_dependent_on_dataapply_to_images if expensive setup (kernels, LUTs, gradient maps) can be computed once per batchndim == 4 checks on images — they're always 4D in batch context(H,W,1)(N,H,W,1) to (H,W,N) for cv2 — 2–4× slower due to non-contiguous copy + sequential channel processingFlag any violations with a concrete speedup suggestion.
Args, Targets, Image types sectionsExamples section present (plural, not "Example")A.Compose with BboxParams and KeypointParams--- sequences in docstring (pre-commit will catch this but check anyway)get_dual_transforms() or get_image_only_transforms() in tests/utils.pyseed=137 (not 42)np.testing assertions (not plain assert)## Review: <TransformName>
### 🔴 Critical
- **Dead code**: `_unused_method` is never called (line 42)
- **API**: Parameter `fill_value` should be `fill`
### 🟡 Important
- **Performance**: Use `cv2.LUT` instead of numpy indexing for pixel mapping (5-10x faster)
- **Docs**: Missing `Examples` section in docstring
### 🟢 Suggestions
- Consider using relative `noise_range` instead of absolute pixel values