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
4 changes: 2 additions & 2 deletions docs/cookbooks/release-demo_1-5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
"metadata": {},
"outputs": [],
"source": [
"import rfdetr.datasets.aug_config as aug_config\n",
"from rfdetr.datasets.aug_config import AUG_AGGRESSIVE\n",
"import rfdetr.datasets.aug_configs as aug_config\n",
"from rfdetr.datasets.aug_configs import AUG_AGGRESSIVE\n",
"\n",
"for name in (\"AUG_CONSERVATIVE\", \"AUG_AGGRESSIVE\", \"AUG_AERIAL\", \"AUG_INDUSTRIAL\"):\n",
" preset = getattr(aug_config, name)\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/learn/train/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ model.train(
)
```

Use a built-in preset by importing it from `rfdetr.datasets.aug_config`:
Use a built-in preset by importing it from `rfdetr.datasets.aug_configs`:

```python
from rfdetr.datasets.aug_config import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL
from rfdetr.datasets.aug_configs import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL

model.train(dataset_dir="path/to/dataset", aug_config=AUG_AGGRESSIVE)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/learn/train/augmentations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pass `aug_config` to your training call. Import one of the built-in presets:

```python
from rfdetr import RFDETRSmall
from rfdetr.datasets.aug_config import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL
from rfdetr.datasets.aug_configs import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL

model = RFDETRSmall()
model.train(dataset_dir="path/to/dataset", epochs=100, aug_config=AUG_CONSERVATIVE)
Expand Down Expand Up @@ -46,7 +46,7 @@ To disable augmentations: `aug_config={}`. Omitting it uses the default (horizon
All presets are plain dicts — inspect or extend them before passing:

```python
from rfdetr.datasets.aug_config import AUG_AGGRESSIVE
from rfdetr.datasets.aug_configs import AUG_AGGRESSIVE

my_config = {**AUG_AGGRESSIVE, "VerticalFlip": {"p": 0.1}}
model.train(dataset_dir="...", aug_config=my_config)
Expand Down
4 changes: 2 additions & 2 deletions notebooks/release-demo_1-5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
"metadata": {},
"outputs": [],
"source": [
"import rfdetr.datasets.aug_config as aug_config\n",
"from rfdetr.datasets.aug_config import AUG_AGGRESSIVE\n",
"import rfdetr.datasets.aug_configs as aug_config\n",
"from rfdetr.datasets.aug_configs import AUG_AGGRESSIVE\n",
"\n",
"for name in (\"AUG_CONSERVATIVE\", \"AUG_AGGRESSIVE\", \"AUG_AERIAL\", \"AUG_INDUSTRIAL\"):\n",
" preset = getattr(aug_config, name)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Import a preset and pass it as ``aug_config`` to your training call:

```python
from rfdetr.datasets.aug_config import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL
from rfdetr.datasets.aug_configs import AUG_CONSERVATIVE, AUG_AGGRESSIVE, AUG_AERIAL, AUG_INDUSTRIAL

model.train(dataset_dir="...", aug_config=AUG_CONSERVATIVE) model.train(dataset_dir="...", aug_config=AUG_AGGRESSIVE)

Expand Down
6 changes: 3 additions & 3 deletions src/rfdetr/datasets/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from PIL import Image
from torchvision.transforms.v2 import Compose, ToDtype, ToImage

from rfdetr.datasets.aug_config import AUG_CONFIG
from rfdetr.datasets.aug_configs import AUG_CONFIG
Comment thread
Borda marked this conversation as resolved.
from rfdetr.datasets.transforms import AlbumentationsWrapper, Normalize
from rfdetr.utilities.logger import get_logger

Expand Down Expand Up @@ -542,7 +542,7 @@ def make_coco_transforms(
:func:`compute_multi_scale_scales` to derive candidate resolutions.
aug_config: Albumentations augmentation config dict passed to
:class:`~rfdetr.datasets.transforms.AlbumentationsWrapper`. Falls back to the default
:data:`~rfdetr.datasets.aug_config.AUG_CONFIG` when ``None``.
:data:`~rfdetr.datasets.aug_configs.AUG_CONFIG` when ``None``.
gpu_postprocess: When ``True``, skip Albumentations augmentation wrappers and
``Normalize`` from the CPU pipeline. The ``RFDETRDataModule`` then applies both augmentation and
normalization on the GPU in ``on_after_batch_transfer``. Has no effect on val/test splits.
Expand Down Expand Up @@ -642,7 +642,7 @@ def make_coco_transforms_square_div_64(
derive the list of candidate square resolutions.
aug_config: Augmentation configuration dictionary compatible with
:class:`~rfdetr.datasets.transforms.AlbumentationsWrapper`. If ``None``, the default
:data:`~rfdetr.datasets.aug_config.AUG_CONFIG` is used.
:data:`~rfdetr.datasets.aug_configs.AUG_CONFIG` is used.
gpu_postprocess: When ``True``, skip Albumentations augmentation wrappers and
``Normalize`` from the CPU pipeline. The ``RFDETRDataModule`` then applies both augmentation and
normalization on the GPU in ``on_after_batch_transfer``. Has no effect on val/test splits.
Expand Down
2 changes: 1 addition & 1 deletion src/rfdetr/datasets/kornia_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def build_kornia_pipeline(
ValueError: If *aug_config* contains an unsupported augmentation key.

Examples:
>>> from rfdetr.datasets.aug_config import AUG_CONSERVATIVE
>>> from rfdetr.datasets.aug_configs import AUG_CONSERVATIVE
>>> pipeline = build_kornia_pipeline(AUG_CONSERVATIVE, resolution=560)
>>> pipeline_seg = build_kornia_pipeline(AUG_CONSERVATIVE, resolution=560, with_masks=True)
"""
Expand Down
2 changes: 1 addition & 1 deletion src/rfdetr/datasets/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def build_roboflow_from_yolo(image_set: str, args: Any, resolution: int) -> Yolo
``dataset_dir``, ``square_resize_div_64``, ``aug_config``, ``segmentation_head``, ``multi_scale``,
``expanded_scales``, ``do_random_resize_via_padding``, ``patch_size``, ``num_windows``. ``aug_config`` is
forwarded to the transform builder; when ``None`` the builder falls back to the default
:data:`~rfdetr.datasets.aug_config.AUG_CONFIG`.
:data:`~rfdetr.datasets.aug_configs.AUG_CONFIG`.
resolution: Target square resolution in pixels.

Returns:
Expand Down
2 changes: 1 addition & 1 deletion src/rfdetr/training/module_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from rfdetr._namespace import _namespace_from_configs
from rfdetr.config import ModelConfig, TrainConfig
from rfdetr.datasets import build_dataset
from rfdetr.datasets.aug_config import AUG_CONFIG
from rfdetr.datasets.aug_configs import AUG_CONFIG
from rfdetr.utilities.box_ops import box_xyxy_to_cxcywh
from rfdetr.utilities.logger import get_logger
from rfdetr.utilities.tensors import make_collate_fn
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_augmentations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from torchvision.transforms.v2 import Compose

from rfdetr.datasets._develop import _SimpleDataset
from rfdetr.datasets.aug_config import AUG_AGGRESSIVE, AUG_CONFIG
from rfdetr.datasets.aug_configs import AUG_AGGRESSIVE, AUG_CONFIG
from rfdetr.datasets.coco import make_coco_transforms, make_coco_transforms_square_div_64
from rfdetr.datasets.transforms import AlbumentationsWrapper, _build_albu_transform
from rfdetr.utilities import collate_fn
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_kornia_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pytest
import torch

from rfdetr.datasets.aug_config import (
from rfdetr.datasets.aug_configs import (
AUG_AERIAL,
AUG_AGGRESSIVE,
AUG_CONSERVATIVE,
Expand Down
2 changes: 1 addition & 1 deletion tests/training/test_module_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def test_gpu_path_uses_aug_config_fallback(self, tmp_path):
import sys
from unittest.mock import MagicMock, patch

from rfdetr.datasets.aug_config import AUG_CONFIG
from rfdetr.datasets.aug_configs import AUG_CONFIG

dm = self._build_dm_with_backend(tmp_path, "auto")
assert dm.train_config.aug_config is None, "precondition: aug_config must be None for this test"
Expand Down
Loading