Skip to content
This repository was archived by the owner on Dec 29, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
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__}')"
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ cython_debug/
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
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
59 changes: 58 additions & 1 deletion README.md
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.
19 changes: 19 additions & 0 deletions config/README.md
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
```
13 changes: 13 additions & 0 deletions examples/README.md
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.
57 changes: 57 additions & 0 deletions pyproject.toml
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"
12 changes: 12 additions & 0 deletions scripts/README.md
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.
6 changes: 6 additions & 0 deletions src/rf_detr_finetuning/__init__.py
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"
5 changes: 5 additions & 0 deletions src/rf_detr_finetuning/data/__init__.py
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.
"""
5 changes: 5 additions & 0 deletions src/rf_detr_finetuning/evaluation/__init__.py
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.
"""
5 changes: 5 additions & 0 deletions src/rf_detr_finetuning/training/__init__.py
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.
"""
5 changes: 5 additions & 0 deletions src/rf_detr_finetuning/utils/__init__.py
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.
"""
28 changes: 28 additions & 0 deletions tests/README.md
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
```