SAM-based parquet plank grid pipeline: normalize lighting → Meta SAM 3 masks → fit a 2D lattice and write debug images / JSON.
uv syncCaveats: NOTES.md.
Ultralytics loads sam3.pt from Meta’s Hugging Face repo facebook/sam3. This pipeline resolves weights in order: a file named sam3.pt next to your working directory (see SAM_WEIGHTS in parquet_sam_grid.py), then the Hugging Face hub cache. It does not download from the Hub automatically—you must fetch the file once.
- Access — Open facebook/sam3, sign in, and accept any license / request access if the card says the model is gated.
- Token — Create a read token at huggingface.co/settings/tokens.
- Authenticate (pick one):
uv run hf auth loginand paste the token, orexport HF_TOKEN=<your_token>in the shell where you download and run.
- Download (pick one; run from the repo root so
--local-dir .lands besideSAM_WEIGHTS):
- Into the project folder (matches the default
sam3.ptfilename): - Or only into the Hub cache (no
sam3.ptin the repo; resolution still finds it under~/.cache/huggingface/hubunless you override cache dirs):hf download facebook/sam3 sam3.pt
Optional: HF_HOME / HF_HUB_CACHE change where cached snapshots live; see hf_hub_cache_dirs() in sam/backend.py.
python3 src/parquet-sam-grid.py --image samples/herringbone.png --text "wooden parquet rectangular planks"Outputs go to outputs/<image_stem>/. Weights: SAM_WEIGHTS in parquet_sam_grid.py (default sam3.pt + hub resolution).