lightly
A deep learning package for self-supervised learning
Decision gist · record as of 2026-08-14
Yes. Lightly is actively maintained, MIT-licensed, and implements a mature set of self-supervised learning algorithms with low install friction. Install it if you need to train on unlabeled image data or experiment with SSL methods. The substantial dependency tree (torch, pytorch_lightning, hydra-core) is typical for deep learning and not a drawback if you're already in that ecosystem; it becomes a consideration only if you're adding it to a minimal environment.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch and torchvision; GPU recommended for practical training but not strictly required.
- Low install friction with a pure-Python wheel.
- Active maintenance with a recent release (18 days old) and steady repository activity.
License · maintenance · safety
permissive license (permissive) — MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
last release 2026-07-27 (18 days) · last repo commit 2026-08-14 · 3,793 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 166,251 downloads/mo, #10,502 on PyPI
Alternatives
Verify before relying
pip install lightly
import lightly
from lightly.models import ResNetSimCLR
from lightly.loss import NTXentLoss
model = ResNetSimCLR()
loss = NTXentLoss()- Whether the package includes pretrained model weights or requires training from scratch.
- Performance characteristics and typical training time for supported models on standard datasets.
- Compatibility with specific PyTorch versions beyond the stated Python version support.
What it is and what it does
Lightly is a self-supervised learning framework built on PyTorch that implements established SSL algorithms for computer vision. It provides modular, low-level building blocks—loss functions, model heads, and complete model implementations—that let you train neural networks on unlabeled image data by learning visual representations through contrastive or other self-supervised objectives. The framework supports models including MoCo, SimCLR, BYOL, SwaV, DenseCL, SimSiam, Barlow Twins, DetConS, DINO, NNCLR, and LeJEPA, with examples for both single-GPU PyTorch and distributed training via PyTorch Lightning.
You use it by selecting a model architecture, defining a loss function, and training on your unlabeled dataset—the learned representations can then be fine-tuned for downstream tasks like classification or detection. The package is designed to be accessible and PyTorch-idiomatic, with extensive documentation and Colab notebooks for each model. It depends on torch, torchvision, pytorch_lightning, hydra-core for configuration, and several utility libraries, making it suitable for research and production workflows where you have unlabeled image data and want to bootstrap a strong visual encoder.
Use it for
- Pretrain a vision encoder on a large unlabeled image dataset, then fine-tune it for classification or detection tasks downstream.
- Experiment with different SSL algorithms (MoCo, SimCLR, BYOL, DINO) to compare their effectiveness on your specific domain.
- Train distributed SSL models across multiple GPUs using PyTorch Lightning integration for large-scale pretraining.
- Build custom SSL pipelines by composing loss functions and model heads for novel self-supervised objectives.
- Reduce labeled data requirements by leveraging self-supervised pretraining before supervised fine-tuning.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Lightly is actively maintained, MIT-licensed, and implements a mature set of self-supervised learning algorithms with low install friction. Install it if you need to train on unlabeled image data or experiment with SSL methods. The substantial dependency tree (torch, pytorch_lightning, hydra-core) is typical for deep learning and not a drawback if you're already in that ecosystem; it becomes a consideration only if you're adding it to a minimal environment.
Install
lightly on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release (18 days old) and steady repository activity. Requires 14 runtime dependencies including torch, torchvision, and pytorch_lightning, which are substantial but standard for deep learning work.
Requires PyTorch and torchvision; GPU recommended for practical training but not strictly required.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install lightly
import lightly
from lightly.models import ResNetSimCLR
from lightly.loss import NTXentLoss
model = ResNetSimCLR()
loss = NTXentLoss()
Verify before relying
- Whether the package includes pretrained model weights or requires training from scratch.
- Performance characteristics and typical training time for supported models on standard datasets.
- Compatibility with specific PyTorch versions beyond the stated Python version support.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 14 packagescertifihydra-corelightly_utilsnumpypython_dateutilrequestssixtqdmtorchtorchvisionpydanticpytorch_lightningurllib3aenum |
| Maintenance | Actively maintained 18 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 166,251 / month, #10,502 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Image ProcessingTopic :: Scientific/Engineering :: MathematicsTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: lightly-1.5.26-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “contrastive learning framework pytorch”
- lightlyLightly provides self-supervised learning models and loss functions…
- pytorch-metric-learningProvides metric learning loss functions, miners, and evaluation tools…
- open-clip-torchOpenCLIP provides open-source implementations of CLIP (Contrastive…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also lightly-utils · nudenet · pytorchcv · groundingdino-py · autogluon.multimodal · segmentation-models-pytorch · autogluon.vision · open-clip-torch · autogluon · efficientnet-pytorch