21 Commits

Author SHA1 Message Date
Jesús Royeth 612d120de0 fix(training): restore GPU memory usage in the progress bar (#1279)
- 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>
2026-08-05 21:51:24 +02:00
Jirka Borovec 42e05c8cd4 fix: all MEDIUM findings across code, docs, tests (#1180)
- Fixed prediction, export, deploy, and benchmarking behavior, including safer URL loading, correct return typing, optimized-model guards, second-training warnings, dynamic input/query handling, and clamped benchmark top-k.
- Fixed dataset loading and augmentation edge cases, including bounded large-image handling, seeded DataLoader workers, configurable Albumentations strictness, corrected non-square resize-crop jitter, GaussianBlur sigma passthrough, and asymmetric blur-range warnings.
- Fixed training and model stability issues, including graph-connected zero mask losses for empty matches, preserved process RNG during training, corrected MultiScaleProjector survival-drop behavior, and removal of obsolete torchvision compatibility logic.
- Fixed box IoU/GIoU NaNs for degenerate boxes while preserving exact IoU for normal boxes.
- Improved mask postprocessing memory usage by chunking interpolation and storing thresholded boolean masks.
- Updated documentation for export, migration, training, installation extras, benchmarks, references, and LLM metadata to match shipped behavior.
- Fixed tests and smoke coverage for checkpoint errors, optimized-model state, mask memory handling, box degeneracy, worker seeding, CLI execution, and updated resize-crop behavior.

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-07-03 19:22:10 +02:00
Jirka Borovec 0fe04294da docs(keypoints): add how-to, API ref and navigation (#1100)
* add how-to, API ref, nav parity with detection/segmentation
* add illustrations, benchmark chart, output reference
* address review findings — accuracy, content, examples
* clarify keypoint custom training

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Codex <codex@openai.com>
2026-06-13 02:36:02 +02:00
Jirka Borovec b1177f11da docs: fix GEO SEO docs build (#989)
Fix docs build dependency drift, sitemap publishing, crawlable changelog content, page descriptions, and strict MkDocs docstring warnings.

Relocated `root-static` to `docs/root-static` for better structure, updated references in workflows, and modernized static files like `robots.txt` and `llms.txt`.

---------

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-23 17:22:59 +02:00
Jirka Borovec f2b5d2130d refactor: split detr.py → inference.py + variants.py (#850)
- 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>
2026-03-23 18:28:06 +01:00
Jirka Borovec cac150a6bf chore(training): rich progress bar, key metrics display, PTL warning fixes (#822)
* 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>
2026-03-19 13:15:57 +01:00
jirka d9889c96e7 docs: comprehensive audit fixes and PTL training documentation
- Fix deprecated rfdetr.util.coco_classes import in README and all
  inference/pretrained docs → rfdetr.assets.coco_classes (B-1)
- Fix trtexec import path in export.md → rfdetr.export.tensorrt (B-2)
- Fix resolution divisibility claim: 56 → 14 in training-parameters.md (B-3)
- Document build_trainer devices=1 default; require devices="auto" kwarg
  for multi-GPU in advanced.md and customization.md (B-4)
- Replace augmentation source-file-editing advice with aug_config= kwarg
  and preset examples in advanced.md (I-1/I-7)
- Note XL/2XLarge models via rfdetr[plus] PML 1.0 in pretrained.md (I-2)
- Document silent UserWarning on missing tensorboard package (I-3)
- Narrow Apache 2.0 scope to Nano-Large on docs homepage (I-4)
- Clarify TrainConfig has no strategy field; use trainer_kwarg (I-5)
- Add COCOEvalCallback and RFDETRCli to reference/training.md (I-6, M-4)
- Add rfdetr.config namespace comment to customization.md imports (I-8)
- Add migration guide for all deprecated rfdetr.util.* shims (M-1)
- Add eval_max_dets, eval_interval, log_per_class_metrics, progress_bar
  and advanced TrainConfig fields to training-parameters.md (M-2/M-3/M-6)
- Add convert_legacy_checkpoint example to customization.md resume section (M-5)
- Add Custom Training API (customization.md) and Training API Reference pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 18:05:52 +01:00
Jirka Borovec 8325584475 Separate platform sub-module & migrate to rfdetr_plus pkg (#645)
* 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>
2026-02-10 21:59:48 +09:00
Peter Robicheaux ef06017cb7 address jiri's comments 2026-01-21 13:00:51 -08:00
SkalskiP 8185ac9e3f Merge branch 'develop' into new-seg-release-dinov2b-release
# Conflicts:
#	rfdetr/models/lwdetr.py
#	rfdetr/models/segmentation_head.py
2026-01-19 16:46:10 +01:00
SkalskiP 734a2cd9d8 update README.md and LICENSE 2026-01-19 16:23:09 +01:00
jirka 12c9e0d1a6 pre-commit run --all-files 2026-01-19 21:05:40 +09:00
Peter Robicheaux a09b24da71 Fix docs 2026-01-14 12:07:04 -08:00
Peter Robicheaux 97cc157f9b Rename and dynamically load new or old RF-DETR-Large based off deprecation 2026-01-14 11:56:18 -08:00
Peter Robicheaux 303824da1a Fix docs 2026-01-13 18:33:15 -08:00
Peter Robicheaux c17e058cb3 Add coumentation 2026-01-13 18:20:48 -08:00
Peter Robicheaux 151b36e111 Release new rf-detr size 2026-01-13 18:05:47 -08:00
James 429c9e8c79 seg launch docs 2025-10-02 23:19:07 +01:00
James cd6d3e2d12 add nano docs page, fix link 2025-07-23 16:34:31 +01:00
James fd4429b325 work on documentation 2025-07-23 14:24:47 +01:00
James bf4ffa5180 work on new docs 2025-07-22 14:31:05 +01:00