lightly-ai / lightly-ai/lightly-train
Export a pretrained embedding model (dinov2/dinov3) without a training run
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 116
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 6
Description
## Problem
To use a LightlyTrain backbone for embeddings — for example to feed LightlyStudio — you have to run a training job first. `export` and `embed` both require a checkpoint, and `pretrain` is the only way to produce one. There is no way to get an embedding model straight from a pretrained backbone name.
`load_model` returns a task model (detection/segmentation), not the embedding backbone. `package_helpers.get_wrapped_model(...)` + `train_helpers.get_embedding_model(...)` do build a pretrained `EmbeddingModel` with no training, but both are private (`_models`, `_commands`).
## Ask
A public API to export or load a pretrained embedding model from a model name, no training:
```python
lightly_train.export(out="model.pt", model="dinov2/vits14", part="embedding_model", format="torch_model")
# or
model = lightly_train.load_embedding_model("dinov2/vits14") # torch.nn.Module
```
Cover the families users reach for first: `dinov2/*` and `dinov3/*`.
## Why
Users who just want good embeddings now should not have to run a 1-epoch training job as a stand-in. The LightlyStudio embeddings tutorial (lightly-ai/lightly-studio#2160) currently does exactly that. A one-liner to drop a stock backbone into an embedding pipeline makes the LightlyTrain → LightlyStudio path feel like a few lines of code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the public export, embed, pretrain, and load_model entry points, then inspect package_helpers.get_wrapped_model(...) and train_helpers.get_embedding_model(...). Define how a model name selects dinov2/* and dinov3/* backbones without training, expose the chosen API, and verify that it returns or exports an embedding model in the requested format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100