Holocron
PyTorch implementations of recent Computer Vision tricks (ReXNet, RepVGG, Unet3p, YOLOv4, CIoU loss, AdaBelief, PolyLoss, MobileOne). Other additions: AdEMAMix
Install / Use
/learn @frgfm/HolocronREADME
Implementations of recent Deep Learning tricks in Computer Vision, easily paired up with your favorite framework and model zoo.
Holocrons were information-storage datacron devices used by both the Jedi Order and the Sith that contained ancient lessons or valuable information in holographic form.
Source: Wookieepedia
Quick Tour
This project was created for quality implementations, increased developer flexibility and maximum compatibility with the PyTorch ecosystem. For instance, here is a short snippet to showcase how Holocron models are meant to be used:
from PIL import Image
from torchvision.transforms.v2 import Compose, ConvertImageDtype, Normalize, PILToTensor, Resize
from torchvision.transforms.v2.functional import InterpolationMode
from holocron.models.classification import repvgg_a0
# Load your model
model = repvgg_a0(pretrained=True).eval()
# Read your image
img = Image.open(path_to_an_image).convert("RGB")
# Preprocessing
config = model.default_cfg
transform = Compose([
Resize(config['input_shape'][1:], interpolation=InterpolationMode.BILINEAR),
PILToTensor(),
ConvertImageDtype(torch.float32),
Normalize(config['mean'], config['std'])
])
input_tensor = transform(img).unsqueeze(0)
# Inference
with torch.inference_mode():
output = model(input_tensor)
print(config['classes'][output.squeeze(0).argmax().item()], output.squeeze(0).softmax(dim=0).max())
Installation
Prerequisites
Python 3.11 (or higher) and uv/pip are required to install Holocron.
Latest stable release
You can install the last stable release of the package using pypi as follows:
pip install pylocron
Developer mode
Alternatively, if you wish to use the latest features of the project that haven't made their way to a release yet, you can install the package from source (install Git first):
git clone https://github.com/frgfm/Holocron.git
pip install -e Holocron/.
Paper references
PyTorch layers for every need
- Activation: HardMish, NLReLU, FReLU
- Loss: Focal Loss, MultiLabelCrossEntropy, MixupLoss, ClassBalancedWrapper, ComplementCrossEntropy, MutualChannelLoss, DiceLoss, PolyLoss
- Convolutions: NormConv2d, Add2d, SlimConv2d, PyConv2d, Involution
- Regularization: DropBlock
- Pooling: BlurPool2d, SPP, ZPool
- Attention: SAM, LambdaLayer, TripletAttention
Models for vision tasks
- Image Classification: Res2Net (based on the great implementation from Ross Wightman), Darknet-24, Darknet-19, Darknet-53, CSPDarknet-53, ResNet, ResNeXt, TridentNet, PyConvResNet, ReXNet, SKNet, RepVGG, ConvNeXt, MobileOne.
- Object Detection: YOLOv1, YOLOv2, YOLOv4
- Semantic Segmentation: U-Net, UNet++, UNet3+
Vision-related operations
Trying something else than Adam
- Optimizer: LARS, Lamb, TAdam, AdamP, AdaBelief, Adan, and customized versions (RaLars), AdEMAMix
- Optimizer wrapper: Lookahead, Scout (experimental)
More goodies
Documentation
The full package documentation is available here for detailed specifications.
Demo app
The project includes a minimal demo app using Gradio

You can check the live demo, hosted on :hugs: HuggingFace Spaces :hugs: over here :point_down:
Reference scripts
Reference scripts are provided to train your models using holocron on famous public datasets. Those scripts currently support the following vision tasks:
Latency benchmark
You crave for SOTA performances, but you don't know whether it fits your needs in terms of latency?
In the table below, you will find a latency benchmark for all supported models:
| Arch | GPU mean (std) | CPU mean (std) | | ------------------------------------------------------------ | ----------------- | ------------------ | | repvgg_a0* | 3.14ms (0.87ms) | 23.28ms (1.21ms) | | repvgg_a1* | 4.13ms (1.00ms) | 29.61ms (0.46ms) | | repvgg_a2* | 7.35ms (1.11ms) | 46.87ms (1.27ms) | | [repvgg_b0](https://frgfm.github.io/Holocron/latest/models.html#holocron.models.repvgg_b
Related Skills
proje
Interactive vocabulary learning platform with smart flashcards and spaced repetition for effective language acquisition.
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
research_rules
Research & Verification Rules Quote Verification Protocol Primary Task "Make sure that the quote is relevant to the chapter and so you we want to make sure that we want to have it identifie
