This repository was archived by the owner on Dec 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Initialize RF-DETR fine-tuning pipeline structure with development tooling and CI automation #1
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9435eb4
Initial plan
Copilot ffe8cf7
Create RF-DETR fine-tuning pipeline structure with modular design
Copilot 7f11d69
Add pre-commit config with Ruff, mdformat, and standard hooks; add pr…
Copilot 4d48607
Restructure src/ with rf_detr_finetuning package, add tests/ folder, …
Copilot 6ebe6cf
Remove __init__.py from src/ and tests/ root directories
Copilot d0c6229
Add GitHub Actions CI workflow to validate package installation and i…
Copilot 008426e
Add explicit permissions to GitHub Actions workflow for security
Copilot d118b02
Add Dependabot and pre-commit CI automation with monthly updates
Copilot 4f943ae
Configure pre-commit.ci with monthly autoupdate and autofix; keep pre…
Copilot 9c4e679
Delete .github/workflows/pre-commit.yml
Borda 0d1f041
Apply suggestions from code review
Borda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| pull_request: | ||
| branches: [main, master] | ||
|
|
||
| jobs: | ||
| validate-package: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install package | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e . | ||
|
|
||
| - name: Validate package import and version | ||
| run: | | ||
| python -c "import rf_detr_finetuning; print(f'Successfully imported rf_detr_finetuning v{rf_detr_finetuning.__version__}')" | ||
Borda marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: check-case-conflict | ||
| - id: check-yaml | ||
| - id: check-json | ||
| - id: check-toml | ||
| - id: check-added-large-files | ||
| - id: check-docstring-first | ||
| - id: detect-private-key | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.7.4 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix] | ||
| - id: ruff-format | ||
|
|
||
| - repo: https://github.com/executablebooks/mdformat | ||
| rev: 0.7.19 | ||
| hooks: | ||
| - id: mdformat | ||
| additional_dependencies: | ||
| - mdformat-gfm | ||
| - mdformat-black |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,58 @@ | ||
| # rf-detr-training-pipeline | ||
| # RF-DETR Training Pipeline | ||
|
|
||
| A modular fine-tuning pipeline for RF-DETR (Real-time DEtection TRansformer) models. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| rf-detr-training-pipeline/ | ||
| ├── config/ # Configuration files for training and evaluation | ||
| ├── src/ | ||
| │ └── rf_detr_finetuning/ # Main package | ||
| │ ├── data/ # Dataset loading and preprocessing | ||
| │ ├── training/ # Training loops and optimization | ||
| │ ├── evaluation/ # Metrics and validation | ||
| │ └── utils/ # Logging, config, visualization | ||
| ├── scripts/ # Executable training/inference scripts | ||
| ├── examples/ # Usage tutorials and demos | ||
| ├── tests/ # Test suite | ||
| └── README.md # This file | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Python 3.10 or higher | ||
|
|
||
| ## Modules | ||
|
|
||
| ### rf_detr_finetuning.data | ||
|
|
||
| Contains data loading, preprocessing, and augmentation logic for RF-DETR training. | ||
|
|
||
| ### rf_detr_finetuning.training | ||
|
|
||
| Implements training loops, optimizer configuration, and learning rate scheduling. | ||
|
|
||
| ### rf_detr_finetuning.evaluation | ||
|
|
||
| Provides evaluation metrics and validation logic for model assessment. | ||
|
|
||
| ### rf_detr_finetuning.utils | ||
|
|
||
| Contains utility functions for logging, configuration management, and visualization. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| See the `examples/` directory for usage examples and tutorials. | ||
|
|
||
| ## Configuration | ||
|
|
||
| Configuration files are stored in the `config/` directory. See `config/README.md` for details. | ||
|
|
||
| ## Scripts | ||
|
|
||
| Executable scripts for training and evaluation are in the `scripts/` directory. See `scripts/README.md` for details. | ||
|
|
||
| ## Testing | ||
|
|
||
| Tests are located in the `tests/` directory. See `tests/README.md` for details on running tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Configuration Files | ||
|
|
||
| This directory contains configuration files for the RF-DETR fine-tuning pipeline. | ||
|
|
||
| Configuration files can include: | ||
|
|
||
| - Model configuration (architecture, hyperparameters) | ||
| - Training configuration (batch size, learning rate, epochs) | ||
| - Data configuration (dataset paths, augmentation settings) | ||
| - Evaluation configuration (metrics, validation settings) | ||
|
|
||
| Example structure: | ||
|
|
||
| ``` | ||
| config/ | ||
| ├── model_config.yaml | ||
| ├── training_config.yaml | ||
| └── data_config.yaml | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Examples | ||
|
|
||
| This directory contains example notebooks and scripts demonstrating how to use the RF-DETR fine-tuning pipeline. | ||
|
|
||
| Examples may include: | ||
|
|
||
| - Quick start tutorials | ||
| - Custom dataset integration examples | ||
| - Fine-tuning on specific tasks | ||
| - Inference and visualization examples | ||
| - Advanced configuration examples | ||
|
|
||
| All examples should be well-documented and runnable with minimal setup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| [project] | ||
| name = "rf-detr-training-pipeline" | ||
| dynamic = ["version"] | ||
| description = "A modular fine-tuning pipeline for RF-DETR (Real-time DEtection TRansformer) models" | ||
| readme = "README.md" | ||
| requires-python = ">=3.10" | ||
| license = {text = "MIT"} | ||
| authors = [ | ||
| {name = "Borda", email = "6035284+Borda@users.noreply.github.com"}, | ||
| ] | ||
| keywords = ["deep-learning", "object-detection", "transformer", "rf-detr", "fine-tuning", "training-pipeline"] | ||
| classifiers = [ | ||
| "Development Status :: 3 - Alpha", | ||
| "Intended Audience :: Developers", | ||
| "Intended Audience :: Science/Research", | ||
| "Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
| "Topic :: Software Development :: Libraries :: Python Modules", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/Borda/rf-detr-training-pipeline" | ||
| Repository = "https://github.com/Borda/rf-detr-training-pipeline" | ||
| Issues = "https://github.com/Borda/rf-detr-training-pipeline/issues" | ||
|
|
||
| [build-system] | ||
| requires = ["setuptools>=61.0", "wheel"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| version = {attr = "rf_detr_finetuning.__version__"} | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
|
|
||
| [tool.ruff] | ||
| line-length = 120 | ||
| target-version = "py310" | ||
|
|
||
| [tool.ruff.lint] | ||
| select = [ | ||
| "F", # Pyflakes | ||
| "W", # pycodestyle warnings | ||
| "I", # isort | ||
| "UP", # pyupgrade | ||
| "D", # pydocstyle | ||
| ] | ||
|
|
||
| [tool.ruff.lint.per-file-ignores] | ||
| "tests/**" = ["D"] # Exclude pydocstyle for tests | ||
| "**/test_*.py" = ["D"] # Exclude pydocstyle for test files | ||
|
|
||
| [tool.ruff.lint.pydocstyle] | ||
| convention = "google" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Scripts | ||
|
|
||
| This directory contains executable scripts for training, evaluation, and other tasks. | ||
|
|
||
| Example scripts: | ||
|
|
||
| - `train.py` - Main training script | ||
| - `evaluate.py` - Evaluation script | ||
| - `inference.py` - Inference script for running predictions | ||
| - `export_model.py` - Model export utilities | ||
|
|
||
| All scripts should be executable and follow Python 3.10+ standards. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| """RF-DETR Fine-tuning Pipeline. | ||
|
|
||
| This package provides a modular pipeline for fine-tuning RF-DETR models. | ||
| """ | ||
|
|
||
| __version__ = "0.1.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Data loading and preprocessing module. | ||
|
|
||
| This module handles dataset loading, data augmentation, and preprocessing | ||
| for RF-DETR training and evaluation. | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Evaluation module. | ||
|
|
||
| This module provides evaluation metrics and logic for assessing | ||
| model performance on validation and test datasets. | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Training module. | ||
|
|
||
| This module contains the training logic, including training loops, | ||
| optimizer configuration, and learning rate scheduling. | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Utility functions module. | ||
|
|
||
| This module contains utility functions for logging, configuration management, | ||
| visualization, and other helper functions. | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Tests | ||
|
|
||
| This directory contains tests for the RF-DETR fine-tuning pipeline. | ||
|
|
||
| ## Structure | ||
|
|
||
| Tests are organized to mirror the source code structure: | ||
|
|
||
| ``` | ||
| tests/ | ||
| ├── test_data.py # Tests for data module | ||
| ├── test_training.py # Tests for training module | ||
| ├── test_evaluation.py # Tests for evaluation module | ||
| └── test_utils.py # Tests for utils module | ||
| ``` | ||
|
|
||
| ## Running Tests | ||
|
|
||
| ```bash | ||
| # Run all tests | ||
| pytest | ||
|
|
||
| # Run with coverage | ||
| pytest --cov=src/rf_detr_finetuning --cov-report=html | ||
|
|
||
| # Run specific test file | ||
| pytest tests/test_data.py | ||
| ``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.