# LightlySSL

> Open-source PyTorch framework for self-supervised learning on images with modular losses, model heads, and distributed training.

LightlySSL is a computer vision framework for self-supervised learning, developed by Lightly and published as an MIT-licensed Python library. It exposes building blocks such as loss functions, projection heads, transforms and datasets so users can pretrain image backbones on unlabeled data. The latest release listed is v1.5.26.

## What It Is

LightlySSL is a Python library written in a PyTorch-like style for training self-supervised models on images. Users prepare an image dataset (folders, labeled sets, video, PyTorch or Hugging Face datasets), apply multi-view augmentations, train a model with a chosen loss, and then produce embeddings. It also includes a command-line tool for training, embedding, cropping and downloading data.

## Supported Methods and Workflow

The documentation provides PyTorch, PyTorch Lightning and distributed PyTorch Lightning examples for many methods, including MoCo, SimCLR, BYOL, SwaV, DINO, DINOv2, MAE, iBOT, VICReg, Barlow Twins, AIM and LeJEPA. Custom backbones are supported, including torchvision and timm models, and tutorials cover pretraining a Detectron2 backbone and finetuning checkpoints. Distributed training uses PyTorch Lightning with distributed gathering of loss terms and synchronized BatchNorm.

## Setup Path

It installs from PyPI with pip and requires Python 3.8+. It depends on PyTorch, Torchvision and PyTorch Lightning. Linux or macOS is recommended. The docs also describe a Python API client for the Lightly platform.

## Where It Fits in the Lightly Family

The README says a commercial version with extra features such as Docker support and single-command pretraining is available through sales. Related Lightly products include LightlyTrain for pretraining and fine-tuning vision models and LightlyStudio for data curation and labeling.

## Features
- Modular loss functions and model heads
- PyTorch and PyTorch Lightning examples for many self-supervised methods
- Custom backbone support including timm and torchvision models
- Distributed multi-GPU training with PyTorch Lightning
- LightlyDataset for image, labeled and video data
- Multi-view collate functions and augmentations
- Command-line tool for training, embedding, cropping and downloading
- ImageNet and CIFAR-10 benchmarks with checkpoints
- Python API client for Lightly platform

## Integrations
PyTorch, PyTorch Lightning, Torchvision, Hugging Face Datasets, timm, Detectron2, Google Colab

## Platforms
MACOS, LINUX, API, DEVELOPER_SDK, CLI

## Pricing
Open Source, Free tier available

## Version
v1.5.26

## Links
- Website: https://docs.lightly.ai/self-supervised-learning/
- Documentation: https://docs.lightly.ai/self-supervised-learning/
- Repository: https://github.com/lightly-ai/lightly
- EveryDev.ai: https://www.everydev.ai/tools/lightlyssl
