Open-source project
frgfm/holocron avatar
frgfm/holocron

Holocron: A PyTorch Grab-Bag of Vision Tricks, Read Before You Adopt

PyTorch implementations of recent Computer Vision tricks (ReXNet, RepVGG, Unet3p, YOLOv4, CIoU loss, AdaBelief, PolyLoss, MobileOne). Other additions: AdEMAMix

329 stars47 forksPythonApache-2.0

At a glance

What is it?
Holocron collects published computer vision techniques, from RepVGG and ReXNet to PolyLoss and AdaBelief, as drop-in PyTorch modules. It is a reference library for engineers who want a specific paper's mechanism without copying code, not a training framework.
Who is it for?
Adopt Holocron if you need a specific published mechanism, such as PolyLoss, DropBlock or a RepVGG backbone, available as an importable PyTorch module with a pretrained checkpoint and a default_cfg you can drive preprocessing from. Do not adopt it if you need a maintained training pipeline, a detection or segmentation framework, or a library with a release cadence you can plan around; the last tagged release in the supplied material is v0.2.1 from July 2022.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The gap Holocron fills: paper code you can import instead of reimplement

Most computer vision papers ship a repository tied to one training script, one dataset and one set of hyperparameters. If you want PolyLoss inside an existing model, you either vendor the author's file and adapt its interfaces, or you rewrite the loss from the equations. Holocron takes the second path out of the equation by publishing each technique as a standalone PyTorch module with the same calling conventions as the rest of the ecosystem. The README frames the goal as "quality implementations, increased developer flexibility and maximum compatibility with the PyTorch ecosystem." The audience is therefore narrow and specific: engineers who already have a training loop and a model, and who need one component from a paper rather than a whole pipeline. Someone starting from zero will find no end-to-end recipe here beyond the classification snippet.

What is actually in the box: layers, losses, models and optimizers

The README groups the contents by role. Under layers there are activations (HardMish, NLReLU, FReLU), losses (Focal Loss, MultiLabelCrossEntropy, MixupLoss, ClassBalancedWrapper, ComplementCrossEntropy, MutualChannelLoss, DiceLoss, PolyLoss), convolutions (NormConv2d, Add2d, SlimConv2d, PyConv2d, Involution), regularization (DropBlock), pooling (BlurPool2d, SPP, ZPool) and attention (SAM, LambdaLayer, TripletAttention). Under models the list covers image classification backbones: Res2Net, Darknet-24, Darknet-19, Darknet-53, CSPDarknet-53, ResNet, ResNeXt, TridentNet, PyConvResNet and ReXNet, with RepVGG, Unet3p, YOLOv4, AdaBelief and MobileOne named in the repository description. Each entry is a citation to a paper, not a claim of a novel contribution. That matters for evaluation: the value is in the port, not the idea, so the question to ask is whether the port is faithful and whether it is still maintained.

The default_cfg pattern and how inference is meant to work

The README's quick tour shows the intended contract. You call a model constructor such as repvgg_a0 with pretrained=True and switch it to eval mode. The model object then carries a default_cfg dictionary holding input_shape, mean, std and classes. Preprocessing is assembled from that dictionary rather than hardcoded: Resize takes config["input_shape"][1:], and Normalize takes config["mean"] and config["std"]. After a forward pass inside torch.inference_mode(), the predicted label comes from config["classes"][output.squeeze(0).argmax().item()]. This is a small design decision with real consequences. It means the normalization statistics travel with the checkpoint, so you cannot silently pair a model with the wrong preprocessing constants, which is a common source of quietly degraded accuracy. It also means the transforms come from torchvision.transforms.v2 in the example, so the library assumes a reasonably current torchvision alongside PyTorch.

Installation: two commands, one Python constraint

Installation is deliberately minimal. The stable release is on PyPI under a different name from the repository: pip install pylocron. For unreleased changes, the README gives the developer path: git clone https://github.com/frgfm/Holocron.git followed by pip install -e Holocron/. The stated prerequisites are Python 3.11 or higher plus uv or pip. That Python floor is worth pausing on. A library whose last tagged release is v0.2.1 from July 2022 but which requires Python 3.11 suggests the packaging metadata has been updated since the release, or that the README tracks main rather than the published wheel. Either way, the constraint is stricter than most PyTorch projects and will exclude older base images. The README does not document any configuration file, environment variable or CLI entry point, so there is nothing else to set up and nothing else to tune.

Where Holocron stops: no trainer, no data pipeline, no detection API

The repository description lists YOLOv4 and Unet3p, and the topics include object detection and image segmentation, but the README's own model section files everything under image classification. There is no documented training loop, dataset loader, augmentation policy, checkpoint format or evaluation harness in the supplied material. If you need to reproduce a paper's reported numbers, Holocron will not do it for you; you supply the data, the schedule and the metric. There is also a versioning problem. Three releases are listed, the newest v0.2.1 in July 2022, with v0.2.0 in February 2022 and v0.1.3 in October 2020. The repository shows a last push in August 2026, so commits continue, but the gap between the release history and the current date means the PyPI package and the main branch may have diverged. Pinning pylocron and expecting main-branch behaviour is a reasonable way to get a surprise.

Holocron versus timm: overlapping backbones, different scope

The obvious comparison is timm, and Holocron's own README credits Ross Wightman's implementation for its Res2Net port, which tells you the two projects share ancestry and some model definitions. The difference is in ambition. timm concentrates on classification and backbone models with a large pretrained weight collection and a consistent model-creation API; Holocron spreads across losses, optimizers, attention modules and pooling layers as well. If you want a pretrained ResNet or a modern vision transformer, timm has the deeper catalogue. If you want PolyLoss, DropBlock or Involution as an importable module next to your model, Holocron is the shorter path. The trade-off is maintenance surface: a library covering many small independent components has more places to fall out of date with PyTorch releases than one focused on model definitions.

Licence, maintenance and the cost of depending on this

Holocron is Apache-2.0, which permits commercial use and modification and includes a patent grant, though the usual caveat applies that licence terms interact with the licences of the papers and any third-party code the ports derive from, and that is a question for your own legal review rather than something this article can settle. The practical maintenance cost is the version skew described above: a package on PyPI named pylocron, a repository named Holocron, a README requiring Python 3.11, and a newest tag from 2022. Upgrading PyTorch is the realistic trigger for breakage, since custom convolution and pooling modules touch internals more often than plain model definitions do. Treat any component you adopt as vendored code: read it, test it against the paper's equations, and be prepared to carry it yourself if the import path changes.

Editorial conclusion

Adopt Holocron if you need a specific published mechanism, such as PolyLoss, DropBlock or a RepVGG backbone, available as an importable PyTorch module with a pretrained checkpoint and a default_cfg you can drive preprocessing from. Do not adopt it if you need a maintained training pipeline, a detection or segmentation framework, or a library with a release cadence you can plan around; the last tagged release in the supplied material is v0.2.1 from July 2022. Before committing, verify three things against the repository itself: that the module you want is still exported from the path shown in the README, that a checkpoint exists for the variant you intend to load, and that the Python version constraint (3.11 or higher) matches your environment, because that constraint is stricter than most PyTorch codebases and will rule out older images.

Official sources

  1. frgfm/holocron on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes