Pick an image, click a pixel: it becomes the anchor. The page shows
- Image and segment: the segment grown from the anchor by the Born sieve (Rule S: a neighbour
jjoins when its edge affinity⟨a_i, a_j⟩²exceedsτ_eand its affinity to the segment prototype⟨a_j, μ⟩²exceedsτ_c;μis re-estimated as the segment grows); - Born membership heatmap:
⟨a_j, μ⟩²for every pixel (toggle: membership to the anchor pixel⟨a_j, a_anchor⟩²).
-
Install the requirements:
pip install -r requirements.txt # torch, numpy, pillow, transformers, huggingface_hub; numba optional -
Export your HuggingFace token before launching. The DINOv3-sat model is gated: first accept Meta's DINOv3 licence at https://huggingface.co/facebook/dinov3-vitl16-pretrain-sat493m with your account, then create a token (https://huggingface.co/settings/tokens, "read" access) and export it in the shell that runs the demo:
export HF_TOKEN=hf_... # your own token; needed to download the DINOv3-sat weights (1.2 GB, once)
Without it, only the backbone-free model works (the DINOv3-sat model reports the missing access in the page).
-
Launch:
python launch.py # serves on 0.0.0.0:8765 python launch.py --port 9000 --device cpu
Open http://<machine>:8765. From another machine, either open that address directly or tunnel the port with
ssh -L 8765:127.0.0.1:8765 <machine> and open http://127.0.0.1:8765.
| path | what |
|---|---|
launch.py |
HTTP server and API (Python standard library) |
bornjepa_lite.py |
model code: P1 patch encoder, DINOv3-sat wrapper, Born head, sieve growth |
static/index.html |
the page |
weights/p1_encoder.pt |
P1 co-occurrence patch encoder (0.2M parameters) |
weights/head_born-p1.pt, weights/head_born-dinov3sat.pt |
trained Born heads |
weights/dinov3-vitl16-pretrain-sat493m/ |
DINOv3 ViT-L/16 SAT-493M (1.2 GB): not in git, downloaded from HuggingFace on first use |
samples/ |
6 crops from each benchmark (JPEG) |
pack.sh |
builds one tarball with every file resolved (for copying the demo elsewhere) |
tools/export_from_repo.py |
developer-only: regenerates weights/ and samples/ from the research repository |
Nothing outside this folder is imported.
DINOv3-sat weights. facebook/dinov3-vitl16-pretrain-sat493m is a gated HuggingFace model: accept Meta's DINOv3
licence on https://huggingface.co/facebook/dinov3-vitl16-pretrain-sat493m, then provide a token (export HF_TOKEN=...
before python launch.py, step 2 above, or huggingface-cli login). The first click with that model downloads the weights (1.2 GB) into
weights/dinov3-vitl16-pretrain-sat493m/; without access the page shows the error and the backbone
5285
-free model still
works. pack.sh builds one archive including whatever is in weights/ (for machines without internet access).
- Images: the sample crops, or upload your own (resized to at most 1024 px on the long side).
- Thresholds: lower
τ_e/τ_cgive larger segments. - Speed: the first click on an image computes its embedding (a few seconds on GPU, longer on CPU); later clicks only re-run the sieve growth.