v1.5.0: Custom augmentations
🚀 Added
-
Custom augmentations via Albumentations. You can now control training augmentations through the
aug_configparameter intrain(). Pass a dictionary of Albumentations transforms, choose a built-in named preset, or disable augmentations entirely. Bounding boxes and segmentation masks are automatically transformed alongside images. (#263, #702)from rfdetr import RFDETRSmall from rfdetr.datasets.aug_config import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL model = RFDETRSmall() # Use a built-in preset model.train(dataset_dir="...", aug_config=AUG_AGGRESSIVE, progress_bar=True) # Or define transforms explicitly model.train( dataset_dir="...", aug_config={ "HorizontalFlip": {"p": 0.5}, "RandomBrightnessContrast": {"brightness_limit": 0.2, "p": 0.4}, "GaussianBlur": {"blur_limit": 3, "p": 0.2}, }, progress_bar=True, ) # Disable all augmentations model.train(dataset_dir="...", aug_config={})
Preset Best for AUG_CONSERVATIVESmall datasets (under 500 images) AUG_AGGRESSIVELarge datasets (2000+ images) AUG_AERIALSatellite / overhead imagery AUG_INDUSTRIALManufacturing / inspection data -
Save augmented training image samples. Enable
save_dataset_grids=TrueinTrainConfigto write 3×3 JPEG grids of augmented training and validation images to your output directory before training begins, making it easy to verify your augmentation pipeline without running a full epoch. (#153)from rfdetr import RFDETRSmall model = RFDETRSmall() model.train(dataset_dir="...", save_dataset_grids=True, output_dir="output/") # Grids are saved to output/: # train_batch0_grid.jpg, train_batch1_grid.jpg, train_batch2_grid.jpg # val_batch0_grid.jpg, val_batch1_grid.jpg, val_batch2_grid.jpg
-
ClearML training logger. Set
clearml=TrueinTrainConfigto stream per-epoch metrics directly to your ClearML project. (#520)from rfdetr import RFDETRSmall model = RFDETRSmall() model.train(dataset_dir="...", clearml=True)
-
MLflow training logger. Set
mlflow=TrueinTrainConfigto log runs and metrics to MLflow, with support for custom tracking URIs and system metrics. (#109)from rfdetr import RFDETRSmall model = RFDETRSmall() model.train(dataset_dir="...", mlflow=True)
-
Progress bar for training and validation. A live progress bar now shows batch-level progress during training and validation, and on-screen logs are structured for easier reading. (#204)
-
devicefield added toTrainConfig, allowing explicit device selection when configuring training programmatically. (#687) -
ModelConfignow raises an error on unknown parameters, preventing silent misconfiguration from typos or stale config keys. (#196) -
TensorRT export guide. New documentation section covering how to convert an exported ONNX model to a TensorRT engine for maximum inference throughput. (#175)
🌱 Changed
OPEN_SOURCE_MODELSconstant deprecated in favour of theModelWeightsenum for cleaner model weight references. (#696)- Added MD5 checksum validation for pretrained weight downloads, preventing silent use of corrupted files. (#679)
🔧 Fixed
- Fixed Albumentations bool-mask crash that occurred during segmentation training. (#706)
- Fixed
UnboundLocalErrorwhen resuming training from a completed checkpoint. (#707) - Prevented corruption of
checkpoint_best_total.pthvia atomic checkpoint stripping. (#708) - Fixed PyTorch 2.9+ compatibility issue with CUDA capability detection. (#686)
- Fixed dtype mismatch error when
use_position_supervised_loss=True. (#447) - Fixed inconsistent return values from
build_model. (#519) - Fixed
positional_encoding_sizetype annotation frombooltoint. (#524) - Fixed ONNX export
output_namesto include masks when exporting segmentation models. (#402) - Fixed
num_selectnot being correctly updated during segmentation model fine-tuning. (#399) - Fixed
np.argwhere→np.argmaxmisuse. (#536) - Fixed COCO sparse category ID remapping logic for non-contiguous or offset category IDs are correctly handled. (#712)
- Fixed segmentation mask filtering when using aggressive augmentations. (#717)
🏆 Contributors
A special welcome to our new contributors and a big thank you to everyone who helped with this release:
- Panagiotis Moraitis (@panagiotamoraiti) (LinkedIn) – Custom Albumentations augmentation wrapper
- Shubham Rajvanshi (@shubsraj) (LinkedIn) – Progress bar and structured training logs
- Clement (@CorporalCleg) – ClearML logger integration
- Lakshman (@lab176344) – MLflow logger integration
- Mattia Di Giusto (@picjul) (LinkedIn) – Save augmented training image samples
- Juan Cobos (@juan-cobos) –
devicefield inTrainConfig - Ahmed Samir (@Ahmed-Samir11) – Error on unknown
ModelConfigparameters - Dominik Baran (@Yozer) (LinkedIn) – Fix segmentation mask filtering with aggressive augmentations
- Sungchul Kim (@sungchul2) (LinkedIn) – Fix
num_selectduring segmentation fine-tuning - Abdul Mukit (@Abdul-Mukit) (LinkedIn) – Fix ONNX export output names for segmentation
- Alarmod (@Alarmod) – PyTorch 2.9+ compatibility fix
- lixiaolei1982 (@lixiaolei1982) – Fix
build_modelreturn values &positional_encoding_sizetype - kawabe-jiw (@kawabe-jiw) – Fix dtype mismatch with
use_position_supervised_loss=True - Andrei Moraru (@AndreiMoraru123) (LinkedIn) –
np.argwhere→np.argmaxfix - Niels Teunissen (@DatSplit) – TensorRT export documentation
- stop1one (@stop1one) (LinkedIn) – Stabilize distributed training & test reliability
- Jirka Borovec (@Borda) (LinkedIn) – Augmentation presets, MD5 weight validation,
ModelWeightsenum, CI/testing infrastructure, docs