8000 GitHub - ayghri/be-jepa · GitHub
[go: up one dir, main page]

Skip to content
ayghriPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Interactive Born-JEPA anchors (self-contained)

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 j joins when its edge affinity ⟨a_i, a_j⟩² exceeds τ_e and 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⟩²).

Run

  1. Install the requirements:

    pip install -r requirements.txt        # torch, numpy, pillow, transformers, huggingface_hub; numba optional
  2. 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).

  3. 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.

Contents

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).

Notes

  • Images: the sample crops, or upload your own (resized to at most 1024 px on the long side).
  • Thresholds: lower τ_e / τ_c give 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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0