Mask Generation
Transformers
Safetensors
LibreYOLO
sam3_video
feature-extraction
sam3.1
promptable-segmentation
image-segmentation
Instructions to use LibreYOLO/LibreSAM31large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LibreYOLO/LibreSAM31large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("mask-generation", model="LibreYOLO/LibreSAM31large")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("LibreYOLO/LibreSAM31large") model = AutoModel.from_pretrained("LibreYOLO/LibreSAM31large", device_map="auto") - LibreYOLO
How to use LibreYOLO/LibreSAM31large with LibreYOLO:
# pip install libreyolo # See the model card for usage: https://huggingface.co/LibreYOLO/LibreSAM31large
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from LibreYOLO/LibreSAM31large: direct link, hf CLI and curl.
- Browser
- Download file 3.47 kB
-
https://huggingface.co/LibreYOLO/LibreSAM31large/resolve/main/README.md
- Command line
-
hf download hf://LibreYOLO/LibreSAM31large/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/LibreYOLO/LibreSAM31large/resolve/main/README.md
3.47 kB
| license: other | |
| license_name: sam-license | |
| license_link: LICENSE | |
| extra_gated_prompt: >- | |
| These weights are redistributed under Meta's SAM License, a copy of which is | |
| included in this repository as LICENSE. By requesting access you agree to be | |
| bound by it. Note in particular that the license prohibits use for military | |
| or warfare purposes, nuclear applications, espionage, and the development or | |
| use of guns or illegal weapons, and that your use must comply with applicable | |
| Trade Controls. Access is not available in comprehensively sanctioned | |
| jurisdictions. | |
| extra_gated_fields: | |
| Name: text | |
| Affiliation: text | |
| Country: country | |
| I accept the terms of the SAM License: checkbox | |
| I confirm I am not located in a comprehensively sanctioned jurisdiction: checkbox | |
| library_name: transformers | |
| pipeline_tag: mask-generation | |
| base_model: facebook/sam3.1 | |
| tags: | |
| - libreyolo | |
| - sam3.1 | |
| - promptable-segmentation | |
| - image-segmentation | |
| # LibreSAM31large | |
| The image path of Meta's [SAM 3.1](https://huggingface.co/facebook/sam3.1) | |
| (detector plus interactive SAM head), converted to the Transformers SAM 3 | |
| layout for LibreYOLO's `LibreSAM("sam3.1")`. Meta publishes SAM 3.1 only as | |
| an original-format checkpoint; this snapshot loads with the stock | |
| `Sam3Model` (text prompts) and `Sam3TrackerModel` (point and box prompts). | |
| ## License: read this before requesting access | |
| These weights are **not** MIT and are not covered by LibreYOLO's license. They | |
| are a derivative of Meta's SAM 3.1 checkpoint, redistributed under Meta's | |
| **SAM License**, included verbatim as [`LICENSE`](LICENSE). Anyone who | |
| redistributes them further must do so under the same terms and include the | |
| agreement. The license bars military or warfare use, nuclear applications, | |
| espionage, and guns or illegal weapons; use must comply with Trade Controls; | |
| reverse engineering is not allowed; publications must acknowledge SAM. | |
| Meta gates the upstream repository with manual approval. This mirror uses | |
| Hugging Face's automatic gate: users accept the SAM License and submit the | |
| fields above, without manual review. | |
| ## Source | |
| - [`facebook/sam3.1`](https://huggingface.co/facebook/sam3.1) at revision | |
| `daa63191845a41281374e725f4c9e51c7a824460`, file `sam3.1_multiplex.pt` | |
| (SHA-256 `0567debeec80ba4ac6369540c6c248025283cb3ff2b92827509e57e2b3541cb6`) | |
| ## Modifications | |
| - Only the image path is kept. The Object Multiplex video tracker weights are | |
| not included: Transformers has no implementation for them. | |
| - Keys are renamed to the SAM 3 layout, query/key/value projections are split, | |
| the class-token position embedding is dropped, the CLIP text projection is | |
| transposed and the point embeddings are concatenated. The mapping is adapted | |
| from the Apache-2.0 Transformers SAM 3 converters and reproduces the official | |
| `facebook/sam3` weights exactly when applied to SAM 3. | |
| - SAM 3.1 dropped the fourth (0.5x) FPN level, which the image path never | |
| reads. It is filled with zeros so the stock SAM 3 configuration loads. | |
| - No learned value was changed. 1637 tensors. | |
| - `config.json`, `processor_config.json`, the tokenizer files and `LICENSE` are | |
| copied byte-for-byte from the pinned upstream revision. | |
| `model.safetensors` SHA-256: `f83ea65d102023229c1dd0167d5b889f14e42e1990c768270adf67c6b7d6be6c` | |
| ## Usage | |
| ```python | |
| from libreyolo import LibreSAM | |
| model = LibreSAM("sam3.1") | |
| model.predict("image.jpg", text="person") | |
| model.predict("image.jpg", points=[500, 375], labels=[1]) | |
| ``` | |