Add Timm image classification via pluggable training backends#19
Merged
Conversation
Introduce a generalized, registry-based training-backend abstraction so training libraries are no longer hard-coded into the orchestration code, and add Timm (PyTorch Image Models) as a first-class image-classification trainer alongside Ultralytics/YOLO. Backend - New app/services/training package: Trainer ABC + TrainContext/TrainResult, a registry (get_trainer/list_frameworks, defaults to ultralytics), shared dataset exporters (ImageFolder + YOLO-detect), and two trainers. - UltralyticsTrainer: behavior-preserving extraction of the existing YOLO training/export/predict logic behind the interface. - TimmTrainer: full classification loop with the complete Timm surface — any backbone (searchable), pooling head + drop rates, full optimizer/ scheduler matrix, mixup/cutmix, model EMA, label smoothing, AMP, channels-last, and the full augmentation pipeline; self-describing checkpoint; ONNX export and predictor. - Thin train_task / onnx_export / evaluation / inference now resolve the framework via the registry and delegate (no library names in orchestration). - framework column on ExperimentRun + ModelArtifact; migration 0008 merges the two open migration heads and adds the columns. - Capabilities API (/api/training/frameworks + model search) drives the form; TrainRequest.framework added and validated against the trainer's tasks. - requirements: add timm and matplotlib (propagate to agent images). Frontend - experiments/new.tsx is now schema-driven: a Framework selector, task/model/ hyperparameter sections rendered from the capabilities API, and a searchable Timm backbone picker. Ultralytics form is unchanged. Tests - Registry, shared dataset exporters, capabilities API, framework persistence/ validation, Timm capability schema, and a gated CPU smoke train. https://claude.ai/code/session_01CGFLcnxLvPEuF1y6W79nfA
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce a generalized, registry-based training-backend abstraction so
training libraries are no longer hard-coded into the orchestration code, and
add Timm (PyTorch Image Models) as a first-class image-classification trainer
alongside Ultralytics/YOLO.
Backend
a registry (get_trainer/list_frameworks, defaults to ultralytics), shared
dataset exporters (ImageFolder + YOLO-detect), and two trainers.
training/export/predict logic behind the interface.
any backbone (searchable), pooling head + drop rates, full optimizer/
scheduler matrix, mixup/cutmix, model EMA, label smoothing, AMP,
channels-last, and the full augmentation pipeline; self-describing
checkpoint; ONNX export and predictor.
framework via the registry and delegate (no library names in orchestration).
two open migration heads and adds the columns.
TrainRequest.framework added and validated against the trainer's tasks.
Frontend
hyperparameter sections rendered from the capabilities API, and a searchable
Timm backbone picker. Ultralytics form is unchanged.
Tests
validation, Timm capability schema, and a gated CPU smoke train.
https://claude.ai/code/session_01CGFLcnxLvPEuF1y6W79nfA