The main change this allows is passing arbitrary functional models as a backbone to a task and arbitrary callables as preprocessing for a task. This should allow a lot more flexible API usage.
Passing Rescaling layer or a Pipeline as preprocessing for a ImageClassifier task.
Running augmentation on the GPU by retracing the backbone with augmentation layers included.
Doing more custom surgery of a backbone.
I also moved our saving routines to a PresetSaver class, but this is really just to be parallel with the PresetLoader we added for transformers/timm conversion. You can still override save_to_preset on a model if you need to. Probably more cleanups to do.
Merging this! The last failure is unrelated, and has to do with image preprocessing on the torch backend and gpu <> cpu errors. I will fix up on the other PR.
The main change this allows is passing arbitrary functional models as a backbone to a task and arbitrary callables as preprocessing for a task. This should allow a lot more flexible API usage.
Rescaling
layer or a Pipeline as preprocessing for aImageClassifier
task.I also moved our saving routines to a
PresetSaver
class, but this is really just to be parallel with thePresetLoader
we added for transformers/timm conversion. You can still overridesave_to_preset
on a model if you need to. Probably more cleanups to do.