yuchen-zhu-zyc commited on
Commit
890f416
·
verified ·
1 Parent(s): 29612a7

Add files using upload-large-folder tool

Browse files
Files changed (4) hide show
  1. LICENSE +61 -0
  2. README.md +115 -0
  3. model.pt +3 -0
  4. model_config.json +8 -0
LICENSE ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SAM License
2
+ Last Updated: November 19, 2025
3
+
4
+ “Agreement” means the terms and conditions for use, reproduction, distribution and modification of the SAM Materials set forth herein.
5
+
6
+
7
+ “SAM Materials” means, collectively, Documentation and the models, software and algorithms, including machine-learning model code, trained model weights, inference-enabling code, training-enabling code, fine-tuning enabling code, and other elements of the foregoing distributed by Meta and made available under this Agreement.
8
+
9
+ “Documentation” means the specifications, manuals and documentation accompanying
10
+ SAM Materials distributed by Meta.
11
+
12
+
13
+ “Licensee” or “you” means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
14
+
15
+
16
+ “Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) or Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
17
+
18
+
19
+ “Sanctions” means any economic or trade sanctions or restrictions administered or enforced by the United States (including the Office of Foreign Assets Control of the U.S. Department of the Treasury (“OFAC”), the U.S. Department of State and the U.S. Department of Commerce), the United Nations, the European Union, or the United Kingdom.
20
+
21
+
22
+ “Trade Controls” means any of the following: Sanctions and applicable export and import controls.
23
+
24
+ By using or distributing any portion or element of the SAM Materials, you agree to be bound by this Agreement.
25
+
26
+
27
+ 1. License Rights and Redistribution.
28
+
29
+
30
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the SAM Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the SAM Materials.
31
+
32
+ b. Redistribution and Use.
33
+ i. Distribution of SAM Materials, and any derivative works thereof, are subject to the terms of this Agreement. If you distribute or make the SAM Materials, or any derivative works thereof, available to a third party, you may only do so under the terms of this Agreement and you shall provide a copy of this Agreement with any such SAM Materials.
34
+
35
+
36
+ ii. If you submit for publication the results of research you perform on, using, or otherwise in connection with SAM Materials, you must acknowledge the use of SAM Materials in your publication.
37
+
38
+
39
+ iii. Your use of the SAM Materials must comply with applicable laws and regulations, including Trade Control Laws and applicable privacy and data protection laws.
40
+ iv. Your use of the SAM Materials will not involve or encourage others to reverse engineer, decompile or discover the underlying components of the SAM Materials.
41
+ v. You are not the target of Trade Controls and your use of SAM Materials must comply with Trade Controls. You agree not to use, or permit others to use, SAM Materials for any activities subject to the International Traffic in Arms Regulations (ITAR) or end uses prohibited by Trade Controls, including those related to military or warfare purposes, nuclear industries or applications, espionage, or the development or use of guns or illegal weapons.
42
+ 2. User Support. Your use of the SAM Materials is done at your own discretion; Meta does not process any information nor provide any service in relation to such use. Meta is under no obligation to provide any support services for the SAM Materials. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
43
+
44
+
45
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE SAM MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SAM MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SAM MATERIALS AND ANY OUTPUT AND RESULTS.
46
+
47
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
48
+
49
+ 5. Intellectual Property.
50
+
51
+
52
+ a. Subject to Meta’s ownership of SAM Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the SAM Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications.
53
+
54
+ b. If you institute litigation or other proceedings against Meta or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the SAM Materials, outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the SAM Materials.
55
+
56
+ 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the SAM Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the SAM Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement.
57
+
58
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
59
+
60
+
61
+ 8. Modifications and Amendments. Meta may modify this Agreement from time to time; provided that they are similar in spirit to the current version of the Agreement, but may differ in detail to address new problems or concerns. All such changes will be effective immediately. Your continued use of the SAM Materials after any modification to this Agreement constitutes your agreement to such modification. Except as provided in this Agreement, no modification or addition to any provision of this Agreement will be binding unless it is in writing and signed by an authorized representative of both you and Meta.
README.md ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ library_name: sam3
4
+ pipeline_tag: image-segmentation
5
+ base_model: facebook/sam3.1
6
+ datasets:
7
+ - adopd/adopd2026
8
+ tags:
9
+ - document-ai
10
+ - sam3.1
11
+ - entity-segmentation
12
+ ---
13
+
14
+ # SAM3.1 Segmentation ADOPD
15
+
16
+ [Thinking with Anchors Project](https://sichenzhu.github.io/thinking-with-anchors/) | **ADOPD 2026 Paper:** *Thinking with Anchors: Grounded and Efficient Document Reasoning* | [ADOPD 2024 Paper](https://openreview.net/forum?id=x1ptaXpOYa) | [Dataset](https://huggingface.co/datasets/adopd/adopd2026) | [Code](https://github.com/SichenZhu/ADOPD2026)
17
+
18
+ ## Model Overview
19
+
20
+ - **Model developer:** Thinking with Anchors project contributors
21
+ - **Base architecture:** [SAM3](https://github.com/facebookresearch/sam3), initialized from the SAM3.1 checkpoint
22
+ - **Task:** text-prompted document entity segmentation
23
+ - **Fine-tuning dataset:** [adopd/adopd2026](https://huggingface.co/datasets/adopd/adopd2026)
24
+ - **Input:** one RGB document image and the text prompt `entity`
25
+ - **Output:** entity boxes, confidence scores, and instance masks
26
+
27
+ ## Description
28
+
29
+ SAM3.1 Segmentation ADOPD uses the SAM3 image architecture initialized from the
30
+ SAM3.1 checkpoint and fine-tuned to segment visual entities in document pages.
31
+ The companion inference interface uses the fixed text prompt `entity` and
32
+ returns class-agnostic instance predictions.
33
+
34
+ ## Training Data
35
+
36
+ The checkpoint was fine-tuned on the ADOPD Doc2Mask task. Public supervision is
37
+ stored in:
38
+
39
+ ```text
40
+ human_annotated_masks[].polygons
41
+ ```
42
+
43
+ The released adapter rasterizes all valid polygon components into
44
+ full-resolution binary masks and creates native SAM3 training datapoints.
45
+
46
+ ## Checkpoint Format
47
+
48
+ `model.pt` contains the official `detector.*` image-model state used for
49
+ inference and weight initialization. It does not include optimizer, scheduler,
50
+ scaler, or trainer state and cannot exactly resume an interrupted training run.
51
+
52
+ ## Quick Start
53
+
54
+ ```bash
55
+ git clone https://github.com/SichenZhu/ADOPD2026.git
56
+ cd ADOPD2026/release_code
57
+
58
+ git clone https://github.com/facebookresearch/sam3.git upstream/sam3
59
+ git -C upstream/sam3 checkout 5dd401d1c5c1d5c3eedff06d41b77af824517619
60
+
61
+ python -m pip install -e 'upstream/sam3[train]'
62
+ python -m pip install -e model_zoo/common
63
+ python -m pip install -e model_zoo/sam3_1
64
+
65
+ hf download adopd/SAM3.1-segmentation-ADOPD \
66
+ --local-dir checkpoints/sam3.1
67
+
68
+ adopd-sam31-infer \
69
+ --checkpoint checkpoints/sam3.1/model.pt \
70
+ --image document.jpg \
71
+ --threshold 0.5 \
72
+ --output prediction.json
73
+ ```
74
+
75
+ `prediction.json` contains pixel-space boxes, confidence scores, and
76
+ uncompressed COCO-style RLE masks.
77
+
78
+ ## Fine-Tuning And Evaluation
79
+
80
+ Use the data adapter, one-node DDP trainer, and sharded evaluation commands in
81
+ [`sam3_1`](https://github.com/SichenZhu/ADOPD2026/tree/main/release_code/model_zoo/sam3_1).
82
+
83
+ ## Limitations
84
+
85
+ The model predicts a single document-entity class and relies on the fixed
86
+ prompt `entity`. Confidence and mask thresholds may require calibration for new
87
+ document domains. Performance can vary with page resolution, language, scan
88
+ quality, and visual style.
89
+
90
+ ## License
91
+
92
+ Use is governed by the SAM license included in this repository and the licenses
93
+ of the upstream SAM3 source and its dependencies.
94
+
95
+ ## Citation
96
+
97
+ Please cite the ADOPD 2026 and ADOPD 2024 papers.
98
+
99
+ ```bibtex
100
+ @misc{zhu2026thinkingwithanchors,
101
+ title={Thinking with Anchors: Grounded and Efficient Document Reasoning},
102
+ author={Sichen Zhu and Yuchen Zhu and Wenzhuo Xu and Jason Kuen and Wanrong Zhu and Jing Shi and Xuan Shen and Quanyi Wang and Yiwei Wang and Yujun Cai and Bing Shuai and Qin Zhang and Yongxin Chen and Shilong Liu and Molei Tao and Jiuxiang Gu},
103
+ year={2026}
104
+ }
105
+ ```
106
+
107
+ ```bibtex
108
+ @inproceedings{gu2024adopd,
109
+ title={{ADOPD}: A Large-Scale Document Page Decomposition Dataset},
110
+ author={Jiuxiang Gu and Xiangxi Shi and Jason Kuen and Lu Qi and Ruiyi Zhang and Anqi Liu and Ani Nenkova and Tong Sun},
111
+ booktitle={The Twelfth International Conference on Learning Representations},
112
+ year={2024},
113
+ url={https://openreview.net/forum?id=x1ptaXpOYa}
114
+ }
115
+ ```
model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ad4f53bdeb3a773a991a3ef62f63651c9032939ca423a62af9d446f7ccb9784
3
+ size 3371876017
model_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "sam3_image",
3
+ "release_variant": "sam3.1_finetune",
4
+ "task": "entity_segmentation",
5
+ "prompt": "entity",
6
+ "checkpoint_format": "sam3_official_detector_model_state",
7
+ "dataset": "adopd/adopd2026"
8
+ }