Keras model zoo hoards 50+ architectures, YOLO, and LLaMA2
It collects nearly every recent vision transformer and CNN into a single Keras package with pretrained weights, then throws in detection, diffusion, and language models for good measure.

What it does
keras_cv_attention_models (alias kecam) is a sprawling model zoo that implements dozens of recent image recognition architectures—ConvNeXt, DaViT, EfficientNet, FastViT, Swin, and many more—in Keras, many with ImageNet pretrained weights. It also folds in object detection (YOLOv8, YOLOX, EfficientDet), segmentation (Segment Anything), text generation (GPT-2, LLaMA2), and even Stable Diffusion, all behind a Keras API.
The interesting bit
The project refuses to stay in its lane: a vision repo that also ships large language models and diffusion U-Net is unusual, and it supports both TensorFlow and PyTorch backends through Keras without rewriting the model definitions. There is also a pragmatic focus on model surgery—tools for stripping heads, calculating FLOPs, exporting ONNX, and benchmarking T4 inference are baked in alongside the architectures.
Key highlights
- Implements a very wide range of recognition models (BEiT, CoAtNet, Hiera, MogaNet, NAT, etc.), detection models, and even LLMs.
- Pretrained weights are available for many models; loading them is designed to be flexible even when changing input shapes or output classes.
- Supports PyTorch and Keras Core backends in addition to standard TensorFlow.
- Includes utilities for FLOPs calculation, ONNX export, and T4 TensorRT inference benchmarking.
- Maintains a
model_summary.csvtracking parameters, FLOPs, accuracy, and inference QPS across the collection.
Caveats
- Explicitly not compatible with Keras 3.x; using recent TensorFlow versions requires legacy Keras workarounds.
- The COCO training script is noted as still under testing.
- T4 inference numbers are published but flagged as reference-only and platform-dependent.
Verdict
Worth a look if you want to benchmark or fine-tune recent vision architectures without leaving the Keras ecosystem. Skip it if you are already committed to Keras 3.x or need production-hardened training pipelines.
Frequently asked
- What is leondgarse/keras_cv_attention_models?
- It collects nearly every recent vision transformer and CNN into a single Keras package with pretrained weights, then throws in detection, diffusion, and language models for good measure.
- Is keras_cv_attention_models open source?
- Yes — leondgarse/keras_cv_attention_models is open source, released under the MIT license.
- What language is keras_cv_attention_models written in?
- leondgarse/keras_cv_attention_models is primarily written in Python.
- How popular is keras_cv_attention_models?
- leondgarse/keras_cv_attention_models has 627 stars on GitHub.
- Where can I find keras_cv_attention_models?
- leondgarse/keras_cv_attention_models is on GitHub at https://github.com/leondgarse/keras_cv_attention_models.