Skip to content

Add LightlyTrain Integration for Pretraining Support#164

Draft
yutong-xiang-97 wants to merge 4 commits intoroboflow:developfrom
lightly-ai:add-lightly-train-support-to-readme
Draft

Add LightlyTrain Integration for Pretraining Support#164
yutong-xiang-97 wants to merge 4 commits intoroboflow:developfrom
lightly-ai:add-lightly-train-support-to-readme

Conversation

@yutong-xiang-97
Copy link
Copy Markdown

@yutong-xiang-97 yutong-xiang-97 commented Apr 15, 2025

Description

Add LightlyTrain Integration for Pretraining Support

LightlyTrain is a novel framework built with PyTorch. It lets you pretrain any computer vision model on your unlabeled data, by leveraging distillation from powerful vision models and using self-supervised learning. With only a few lines of code, the community can pretrain domain-specific backbones for any downstream task with a RF-DETR backbone and beyond. We think pretraining on custom domains is a great addition to the current RF-DETR, which is why we would love to feature our integration to your README.

You can simply start pretraining RF-DETR by:

import lightly_train

if __name__ == "__main__":
    lightly_train.train(
        out="out/my_experiment",                # Output directory.
        data="my_data_dir",                     # Directory with images.
        model="rfdetr/rf-detr-base",            # Pass the RF-DETR model.
    )

and fine-tune using the checkpoint by:

# fine_tune.py
from rfdetr import RFDETRBase
from roboflow import Roboflow

if __name__ == "__main__":
    model = RFDETRBase(pretrain_weights="out/my_experiment/exported_models/exported_last.pt")
      
    model.train(dataset_dir=<DATASET_PATH>)

You can also check our docs and product page for more details.

Changes

This PR contains

  • a short intro to LightlyTrain added to the “Training” section in the README file

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

N/A

Any specific deployment considerations

N/A

Docs

  • Docs updated? What were the changes:

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 15, 2025

CLA assistant check
All committers have signed the CLA.

@isaacrob-roboflow
Copy link
Copy Markdown

we use a dinov2 pretrained backbone. the comparisons you have in your library are with imagenet-pretrained classifiers, which are much less relevant to the target task. do you have evidence that your approach helps for this model?

@SkalskiP SkalskiP mentioned this pull request Apr 22, 2025
@liopeer
Copy link
Copy Markdown

liopeer commented Oct 8, 2025

Hi @isaacrob-roboflow! We now also support distilling DINOv3 into RF-DETR backbones.

@isaacrob-roboflow
Copy link
Copy Markdown

Ok. Still not useful as our backbone is a DINOv2 plus o365 pretraining. Distilling DINOv3 into that removes the pretraining.

@Borda Borda requested a review from SkalskiP January 22, 2026 16:36
@Borda Borda added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 22, 2026
@Borda Borda marked this pull request as draft January 28, 2026 14:17
@Borda Borda force-pushed the develop branch 4 times, most recently from 60b16c1 to 523f9df Compare February 14, 2026 06:46
@Borda Borda force-pushed the develop branch 3 times, most recently from a6e6ca0 to 0485141 Compare March 13, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request has conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants