- Reset torch.cuda.reset_peak_memory_stats at fit start (gated by _is_cuda), so max_mem reflects this run's footprint rather than a process-lifetime / batch_size="auto"-probe peak (#2)
- Warn via rank_zero_warn + setdefault instead of silently overwriting a same-named user-logged metric (#3)
- Reword class docstrings from "GPU" to "CUDA" for accuracy — implementation is CUDA-only (#4)
- Add ProgressBar base to _GpuMemoryMetricsMixin, dropping the now-unresolvable type:ignore[misc] (#5, subsumes #17)
- Test peak-reset semantics across sequential get_metrics() calls (#6)
- Add missing Rich progress bar coverage for the cuda-present-but-not-initialized branch (#7)
- Test _is_cuda with None/non-torch.device input (#8)
- Add rounding-boundary test cases (0 bytes, 0.5MB boundary) (#9)
- Fold xla/tpu device-type case into the existing non-cuda parametrize (#10)
- Fix module docstring overstating on_test_end's gating mechanism (#14)
- Document max_mem as rank-local under DDP (#15)
- Match legacy "123 MB" spacing (space before unit) for restoration parity (#18)
---------
Co-authored-by: Jesús Royeth <JESUSROYETH@users.noreply.github.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
- Extract `ModelContext`, `_ModelContext`, `_build_model_context` into
`src/rfdetr/inference.py` (new)
- Extract 14 concrete model variant classes into `src/rfdetr/variants.py`
(new); documents the circular-import load-order invariant in the module
docstring
- `src/rfdetr/detr.py` retains `RFDETR` base class and re-exports all
extracted names at the bottom for full backward compatibility
- `rfdetr/__init__.py` is unchanged — all existing import paths continue
to work through the `detr.py` shim
- Add `TestImportPaths` (22 tests) to `tests/utilities/test_package.py`
verifying importability from all three paths and object identity across
re-exports
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat(training): rich progress bar, key metrics display, PTL warning fixes
Progress bar:
- `TrainConfig.progress_bar` changed from `bool` to `Literal["rich","tqdm"] | None`
— explicit control over bar style; `None` disables (default)
- `build_trainer()` adds `RichProgressBar` with `metrics_format=".3e"` for
scientific notation (fixes `train/lr: 0.000` truncation)
Metrics in progress bar:
- `train/loss` forced `on_step=True` — visible every step regardless of
`train_log_on_step` config
- `val/loss` added `prog_bar=True`
- `train/lr_min` / `train/lr_max` removed from progress bar (clutter); still
logged to CSV/TensorBoard
- `val/mAP_50_95`, `val/mAP_50`, `val/ema_mAP_50_95`, `val/F1` added
`prog_bar=True` in `COCOEvalCallback`
PTL warning fixes:
- `transfer_batch_to_device` moved from `RFDETRModule` to `RFDETRDataModule`
— silences PTL heuristic warning when a DataModule is passed to `fit()`
- `pyproject.toml`: add `notebooks/*.py` to ruff `per-file-ignores` for E402
(cell-local imports are intentional in percent-format scripts)
---
- trainer.py: add explicit TQDMProgressBar callback for progress_bar="tqdm" so it
no longer silently falls through to RichProgressBar on PTL 2.6
- module.py: respect train_log_on_step config for train/loss (was hard-coded on_step=True,
inconsistent with all other train/* metrics)
- test_module.py: remove TestTransferBatchToDevice (hook moved to DataModule)
- test_datamodule.py: add TestTransferBatchToDevice (4 tests) targeting
RFDETRDataModule.transfer_batch_to_device; add _make_batch helper + NestedTensor import
- test_trainer.py (new): TestProgressBarCallbacks (rich/tqdm/None) +
TestCoerceLegacyProgressBar (5 parametrized legacy-bool coercion tests)
- test_detr_shim.py / __init__.py: fix stale RFDETRModule refs to RFDETRModelModule
to complete the class rename the PR had partially applied
- Updated all imports, type hints, and assertions to reflect the class rename.
- Adjusted documentation examples to use `RFDETRModelModule`.
- Ensured compatibility across training, CLI, and inference workflows.
- Replaced deprecated references in synthetic benchmarks, COCO tests, and helper functions.
- Updated all docstrings, comments, and assertions to align with the new class name.
- Ensured consistent terminology across documentation, tests, and helper functions.
- Updated import paths across codebase and tests to reflect new module names.
- Ensured consistent references in documentation, comments, and test fixtures.
- Addressed all affected helper functions and regression tests.
- Adjusted test imports and mock paths to align with the `module` → `module_model` and `datamodule` → `module_data` renaming.
- Updated class references from `RFDETRModule` to `RFDETRModelModule` in test files.
- Corrected references from `module` to `module_model` and `datamodule` to `module_data`.
- Updated docstrings and auto-doc paths for consistency with recent renames.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Separate platform license references and migrate to `rfdetr_plus` module
* Refactor `rfdetr_plus` platform models to add `__all__` and simplify `_INSTALL_MSG` formatting
* Refactor platform initialization to centralize `INSTALL_MSG` and update `__all__` handling
* Remove PML-1.0 license header checks from license validation script
* Consolidate license files by merging LICENSE.core into LICENSE
* Update platform models to require `rfdetr[plus]` and improve `_INSTALL_MSG` handling
* Update README and documentation to clarify `rfdetr_plus` usage with △ models and licensing details
* Add CI workflow for integration tests and remove `--prerelease=allow` from package installation
* Update CI workflows to use `rfdetr[plus]` for documentation builds
* Refactor platform initialization to enhance lazy loading of `rfdetr_plus` exports and improve `_INSTALL_MSG` handling
* Remove unused import `PLATFORM_MODELS` and enhance CI workflow with OS and Python version matrix
* Refactor `download_pretrain_weights` to optimize lazy loading of `PLATFORM_MODELS` and streamline hosted model checks
* Simplify CI integration test imports by removing unused `RFDETR2XLargePlatform` and `RFDETRXLargePlatform` references
* Remove unsupported `rf-detr-xlarge.pth` and `rf-detr-xxlarge.pth` model references
* Apply suggestions from code review
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>