DeiT

DeiT (Data-efficient image Transformer) is a plain Vision Transformer classifier trained on ImageNet-1k alone, with no extra pretraining data. LibreYOLO carries the tiny, small and base patch-16 sizes as a frozen, inference-only exhibit.

Tasks
classify
Sizes
t, s, b at 224 px
Install
pip install libreyolo
Support tier
Museum, since v. Frozen exhibit. Bug fixes only.
Upstream
DeiT by Meta Research, Apache-2.0. Paper, source
Licenses
Code Apache-2.0, weights Apache-2.0. Commercial use

Install

DeiT needs no extra beyond the base package.

bash
pip install libreyolo

Predict

This family is inference-only: train() raises NotImplementedError, so this page has no Train section. Predict, validate and export are all supported. Weights download from Hugging Face on first use and are cached locally. The -cls suffix in the filename is required and selects the classification task.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreDeiTb-cls.pt")result = model(SAMPLE_IMAGE) print(result.probs.top1, result.probs.top1conf)print(result.probs.top5)
CLI
libreyolo predict model=LibreDeiTb-cls.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg

The returned Results object carries a probs tensor instead of boxes; top1 and top5 index the 1,000 ImageNet-1k classes and top1conf is the softmax score for the top prediction. Each size has a fixed input resolution from its positional embedding: preprocessing resizes and center-crops to it, and passing a different imgsz raises rather than silently resampling. See prediction for sources, streaming and result handling.

Validate

val() returns a dictionary with top-1 and top-5 accuracy, measured against a dataset laid out in the conventional train/<class>/ and val/<class>/ folder structure.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreDeiTb-cls.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/accuracy_top1"])print(metrics["metrics/accuracy_top5"])
CLI
libreyolo val model=LibreDeiTb-cls.pt data=my-dataset.yaml

Export

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
classifyclassify to ONNX: supported. classify to TorchScript: supported. classify to ExecuTorch: supported. classify to TensorRT: supported. classify to OpenVINO: supported. classify to Paddle: not supportedclassify to MNN: not supportedclassify to RKNN: not supportedclassify to ncnn: supported. classify to TFLite: not supportedclassify to CoreML: not supportedclassify to Core AI: not supported

An exported artifact loads back through LibreYOLO() on its file suffix, so a .onnx or .engine file behaves like a checkpoint and returns the same Results. Running the graph in a bare runtime, with no LibreYOLO installed, is also supported, but then preprocessing and postprocessing are yours to write.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreDeiTb-cls.pt")model.export(format="onnx")model.export(format="tensorrt", half=True)
CLI
libreyolo export model=LibreDeiTb-cls.pt format=onnxlibreyolo export model=LibreDeiTb-cls.pt format=tensorrt half=True
Use the exported file
from libreyolo import LibreYOLO, SAMPLE_IMAGE # The factory routes on the file suffix, so an exported artifact loads# like any checkpoint and returns the same Results object.model = LibreYOLO("LibreDeiTb-cls.onnx")result = model(SAMPLE_IMAGE) print(result.probs.top1)

Checkpoints

Every published weight file for this family.

FileInput (px)Weights license
classify
LibreDeiTt-cls.pt224apache-2.0
LibreDeiTs-cls.pt224apache-2.0
LibreDeiTb-cls.pt224apache-2.0

Every file above exists in the LibreYOLO org today and downloads on first use.

Licensing

Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.

This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.

Original work
DeiT, Meta Research
Upstream license
Apache-2.0
LibreYOLO code
MIT
Weights
Apache-2.0, republished at huggingface.co/LibreYOLO
Interpretation
Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code, and weights you train yourself on your own data are yours. LibreYOLO ships the plain tiny, small and base patch-16 classifiers at fixed 224px only; the distillation-token, CaiT, DeiT III and 384px variants from the same repository are out of scope.

Citation

@InProceedings{pmlr-v139-touvron21a,
  title =     {Training data-efficient image transformers & distillation through attention},
  author =    {Touvron, Hugo and Cord, Matthieu and Douze, Matthijs and Massa, Francisco and Sablayrolles, Alexandre and Jegou, Herve},
  booktitle = {International Conference on Machine Learning},
  pages =     {10347--10357},
  year =      {2021},
  volume =    {139},
  month =     {July}
}

Copied from the authors' citation block at github.com/facebookresearch/deit#-model-zoo.

Verified against LibreYOLO v1.5.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.