Luximm.jl
timm backbones for Lux.jl
Pretrained weights loaded directly from HuggingFace Hub in .safetensors format.
Pretrained weights
create_pretrained returns a Lux model and a closure that loads the released timm weights into (ps, st).
Backbone families
ResNet, SE-ResNet, BiT ResNetV2, ConvNeXt, ConvNeXt V2, VGG, ViT, and CoAtNet, each with its weight license listed below.
Feature extraction
Drop the classifier head with num_classes = 0, or return a multi-scale feature pyramid with features_only = true.
Parity tested
For every registered variant, the Julia forward must match the timm forward on the same input and weights.
Porting guide
A contributor guide for adding a new timm backbone, with the parity-driven workflow.
Overview
Julia ports of timm (PyTorch Image Models, by Ross Wightman) backbones for Lux.jl, with pretrained weights loaded directly from HuggingFace Hub in .safetensors format. The name is an homage to the project we port from.
Status
Most of Luximm was written by AI agents driving the porting workflow encoded in skills/timm-to-lux/, with human review at each phase and the parity tests as the correctness backstop. The code is already being used in real projects, so the registered backbones work for forward inference with the released weights. That said: expect bugs and rough edges, especially around anything the parity tests do not exercise (custom training loops, mixed-precision paths, exotic input shapes). File issues and PRs.
Available backbones
| Family | Variant prefix | Weights | Weight License | Commercial Use |
|---|---|---|---|---|
| ResNet | :resnet* | 5 | Apache 2.0 | ✅ |
| BiT ResNetV2 | :resnetv2_*_bit_* | 15 | Apache 2.0 | ✅ |
| ConvNeXt | :convnext_* | 19 | Apache 2.0 | ✅ |
| ConvNeXt (DINOv3) | :convnext_* | 4 | DINOv3 License | ⚠️ |
| ConvNeXt V2 | :convnextv2_* | 26 | CC BY-NC 4.0 | ❌ |
| VGG | :vgg* | 8 | CC BY 4.0 | ✅ |
| SE-ResNet | :seresnet* | 1 | Apache 2.0 | ✅ |
| ViT | :vit_* | 4 | Apache 2.0 | ✅ |
| CoAtNet | :coatnet_* | 5 | Apache 2.0 | ✅ |
At a glance
using Luximm, Lux, Random# ResNet50 with the trained 1000-class ImageNet head.# `create_pretrained` is family-agnostic; the symbol selects the# family. It returns the model and a closure that loads the released# weights into `(ps, st)` once you've run `Lux.setup`.model, load = create_pretrained(:resnet50_a1_in1k)ps, st = Lux.setup(Xoshiro(0), model)ps, st = load(ps, st)st = Lux.testmode(st) # BatchNorm/Dropout in eval modex = randn(Float32, 224, 224, 3, 1)logits, _ = model(x, ps, st) # (1000, 1)top1 = argmax(vec(logits)) # ImageNet class indexSee Getting Started for the full walkthrough, including feature-extractor mode (num_classes = 0) and single-channel inputs.
Where to go next
- Getting Started: end-to-end prediction example, switching families, grayscale inputs, HuggingFace cache.
- Porting Backbones: contributor guide for adding a new
timmbackbone, with the parity-driven workflow. - Testing: how the parity test suite is structured, the env-var filters, and how to dump a fixture for a new variant.
- API Reference: every exported function and type.