Luximm.jl

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 .claude/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

FamilyVariant prefixWeightsWeight LicenseCommercial Use
ResNet:resnet*5Apache 2.0
BiT ResNetV2:resnetv2_*_bit_*15Apache 2.0
ConvNeXt:convnext_*19Apache 2.0
ConvNeXt (DINOv3):convnext_*4DINOv3 License⚠️
ConvNeXt V2:convnextv2_*26CC BY-NC 4.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 mode

x = randn(Float32, 224, 224, 3, 1)
logits, _ = model(x, ps, st)          # (1000, 1)
top1 = argmax(vec(logits))            # ImageNet class index

See 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 timm backbone, 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.