alexwaolson commited on
Commit
14970f6
·
verified ·
1 Parent(s): 7ebdef3

Model card, DINOv3 License, MIT licence of the Python files, release notes

Browse files

Adds README.md (model card), LICENSE.md (the DINOv3 License, a copy of the agreement), LICENSE-MIT.txt (for configuration_spatial_embeddings.py and modeling_spatial_embeddings.py) and RELEASE_NOTES.md. Removes ten '._' files that macOS wrote beside the model files. The weights, the configuration and the Python files do not change.

._config.json DELETED
Binary file (4.1 kB)
 
._configuration_spatial_embeddings.py DELETED
Binary file (4.1 kB)
 
._model-00001-of-00006.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e85caf548be1ae8220b040543e9a72797a8138126df4bcf2ba9d6fc655ee337
3
- size 4096
 
 
 
 
._model-00002-of-00006.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e85caf548be1ae8220b040543e9a72797a8138126df4bcf2ba9d6fc655ee337
3
- size 4096
 
 
 
 
._model-00003-of-00006.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e85caf548be1ae8220b040543e9a72797a8138126df4bcf2ba9d6fc655ee337
3
- size 4096
 
 
 
 
._model-00004-of-00006.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e85caf548be1ae8220b040543e9a72797a8138126df4bcf2ba9d6fc655ee337
3
- size 4096
 
 
 
 
._model-00005-of-00006.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e85caf548be1ae8220b040543e9a72797a8138126df4bcf2ba9d6fc655ee337
3
- size 4096
 
 
 
 
._model-00006-of-00006.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e85caf548be1ae8220b040543e9a72797a8138126df4bcf2ba9d6fc655ee337
3
- size 4096
 
 
 
 
._model.safetensors.index.json DELETED
Binary file (4.1 kB)
 
._modeling_spatial_embeddings.py DELETED
Binary file (4.1 kB)
 
LICENSE-MIT.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ This licence covers the two Python files of the model repository,
4
+ configuration_spatial_embeddings.py and modeling_spatial_embeddings.py.
5
+ The model weights are under the DINOv3 License (LICENSE.md).
6
+
7
+ Copyright (c) 2026 Alexander W. Olson and Shoshanna Saxe
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
LICENSE.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DINOv3 License
2
+
3
+ *Last Updated: August 19, 2025*
4
+
5
+ **“Agreement”** means the terms and conditions for use, reproduction, distribution and modification of the DINO Materials set forth herein.
6
+
7
+ **“DINO 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
+ DINO Materials distributed by Meta.
11
+
12
+ **“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.
13
+
14
+ **“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).
15
+
16
+ **“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.
17
+
18
+ **“Trade Controls”** means any of the following: Sanctions and applicable export and import controls.
19
+
20
+ By clicking “I Accept” below or by using or distributing any portion or element of the DINO Materials, you agree to be bound by this Agreement.
21
+
22
+ ## 1. License Rights and Redistribution.
23
+
24
+ a. <ins>Grant of Rights</ins>. 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 DINO Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the DINO Materials.
25
+
26
+ b. <ins>Redistribution and Use</ins>.
27
+
28
+ i. Distribution of DINO Materials, and any derivative works thereof, are subject to the terms of this Agreement. If you distribute or make the DINO 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 DINO Materials.
29
+
30
+ ii. If you submit for publication the results of research you perform on, using, or otherwise in connection with DINO Materials, you must acknowledge the use of DINO Materials in your publication.
31
+
32
+ iii. Your use of the DINO Materials must comply with applicable laws and regulations, including Trade Control Laws and applicable privacy and data protection laws.
33
+
34
+ iv. Your use of the DINO Materials will not involve or encourage others to reverse engineer, decompile or discover the underlying components of the DINO Materials.
35
+
36
+ v. You are not the target of Trade Controls and your use of DINO Materials must comply with Trade Controls. You agree not to use, or permit others to use, DINO 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.
37
+
38
+ ## 2. User Support.
39
+
40
+ Your use of the DINO 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 DINO Materials. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
41
+
42
+ ## 3. Disclaimer of Warranty.
43
+
44
+ UNLESS REQUIRED BY APPLICABLE LAW, THE DINO 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 DINO MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE DINO MATERIALS AND ANY OUTPUT AND RESULTS.
45
+
46
+ ## 4. Limitation of Liability.
47
+
48
+ 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.
49
+
50
+ ## 5. Intellectual Property.
51
+
52
+ a. Subject to Meta’s ownership of DINO Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the DINO 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 DINO 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 DINO Materials.
55
+
56
+ ## 6. Term and Termination.
57
+
58
+ The term of this Agreement will commence upon your acceptance of this Agreement or access to the DINO 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 DINO Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement.
59
+
60
+ ## 7. Governing Law and Jurisdiction.
61
+
62
+ 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.
63
+
64
+ ## 8. Modifications and Amendments.
65
+
66
+ 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 DINO 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,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: dinov3-license
4
+ license_link: LICENSE.md
5
+ base_model: facebook/dinov3-vit7b16-pretrain-lvd1689m
6
+ library_name: transformers
7
+ pipeline_tag: image-feature-extraction
8
+ tags:
9
+ - image-embedding
10
+ - buildings
11
+ - street-level-imagery
12
+ - dinov3
13
+ ---
14
+
15
+ # Spatial building embeddings
16
+
17
+ This model turns a street-level photograph of a building into a 256-dimensional
18
+ embedding. It is the embedding model of the paper *A global typology of buildings seen
19
+ from the street* (A. W. Olson and S. Saxe), which calls the embedding R.
20
+
21
+ The revision that the paper used is `7ebdef3b61de34c733268e87b600d63d223d4f15`.
22
+ `RELEASE_NOTES.md` lists what later revisions change.
23
+
24
+ ## The model
25
+
26
+ The model is a DINOv3 ViT-7B/16 backbone
27
+ ([`facebook/dinov3-vit7b16-pretrain-lvd1689m`](https://huggingface.co/facebook/dinov3-vit7b16-pretrain-lvd1689m),
28
+ Meta) followed by a projection head. The backbone is frozen: its weights are Meta's,
29
+ unchanged.
30
+
31
+ The projection head maps the backbone's 4,096 features to the embedding. It is a
32
+ multilayer perceptron with three hidden layers of width 384 (4,096 → 384 → 384 → 384 →
33
+ 256; GELU activations, dropout 0.1, no normalisation layers) plus a learned linear
34
+ shortcut from input to output. The output has unit length.
35
+
36
+ The repository holds the weights of both parts: 6,719,051,392 parameters, of which
37
+ 3,016,320 are the projection head, in 32-bit floating point (six safetensors files,
38
+ about 27 GB).
39
+
40
+ ## Training
41
+
42
+ The projection head was trained to recognise the same building in different
43
+ photographs, with a triplet margin loss. Positives are other photographs of the same
44
+ building. Negatives are drawn from bands of visual similarity that an
45
+ upper-confidence-bound bandit selects. Hyperparameters were set with Optuna on
46
+ validation recall at 100, with early stopping.
47
+
48
+ The training data were the 3D Street View dataset (Zamir et al. 2016): 1,006,160
49
+ buildings and 5,772,534 images from eight cities (New York, Chicago, Washington, Las
50
+ Vegas, San Francisco, Florence, Amsterdam and Paris). The photographs of the paper were
51
+ not used in training.
52
+
53
+ The training code is in the folder `model_training/` of the paper's code repository.
54
+
55
+ ## How to use it
56
+
57
+ Loading the model reads the configuration and the image processor of the backbone from
58
+ Meta's repository, which is gated. Accept the DINOv3 licence on the page of
59
+ `facebook/dinov3-vit7b16-pretrain-lvd1689m` and log in to Hugging Face first.
60
+
61
+ ```python
62
+ import torch
63
+ from PIL import Image
64
+ from transformers import AutoImageProcessor, AutoModel
65
+
66
+ REVISION = "7ebdef3b61de34c733268e87b600d63d223d4f15"
67
+ model = AutoModel.from_pretrained(
68
+ "alexwaolson/spatial-building-embeddings",
69
+ revision=REVISION,
70
+ trust_remote_code=True,
71
+ low_cpu_mem_usage=False,
72
+ ).eval()
73
+ processor = AutoImageProcessor.from_pretrained(model.config.backbone_model_name)
74
+
75
+ image = Image.open("building.jpg").convert("RGB")
76
+ inputs = processor(images=[image], return_tensors="pt")
77
+ with torch.no_grad():
78
+ embedding = model(**inputs)[0] # shape (1, 256), unit length
79
+ ```
80
+
81
+ `trust_remote_code=True` is needed because the projection head is a class defined in
82
+ this repository (`modeling_spatial_embeddings.py`). The paper's embeddings were computed
83
+ with transformers 4.57.1 and torch 2.15.0, on 640 × 640 pixel frames.
84
+
85
+ ## What it is for, and its limits
86
+
87
+ The model was made to compare buildings by their appearance from the street: to find
88
+ similar buildings and to group them. The paper clusters the embeddings of 946,635
89
+ buildings in 221 countries and territories into eleven archetypes.
90
+
91
+ - The head was trained on photographs from eight cities in the United States and Europe.
92
+ The paper applies it worldwide and reports how the resulting typology was checked.
93
+ - The embedding describes the whole photograph, not only the building. In the paper, a
94
+ linear probe recovers the continent of a photograph from its embedding with balanced
95
+ accuracy 0.933. An analysis that must not depend on location or scene should control
96
+ for them.
97
+ - It has not been evaluated for any other use.
98
+
99
+ ## Licence
100
+
101
+ The weights include the DINOv3 backbone. The model is therefore distributed under the
102
+ **DINOv3 License** of Meta; `LICENSE.md` is a copy of that agreement, and its terms apply
103
+ to any use or redistribution of this model. Among them: redistribution only under the
104
+ same agreement and with a copy of it, and an acknowledgement of DINOv3 in publications
105
+ of research that uses it.
106
+
107
+ The two Python files of this repository, `configuration_spatial_embeddings.py` and
108
+ `modeling_spatial_embeddings.py`, are under the MIT licence (`LICENSE-MIT.txt`).
109
+
110
+ This model is built with DINOv3.
111
+
112
+ ## How to cite
113
+
114
+ Olson, A. W. & Saxe, S. A global typology of buildings seen from the street
115
+ (in preparation, 2026).
116
+
117
+ Siméoni, O. et al. DINOv3. Preprint at https://arxiv.org/abs/2508.10104 (2025).
118
+
119
+ Zamir, A. R. et al. Generic 3D representation via pose estimation and matching. In
120
+ *Proc. European Conference on Computer Vision (ECCV 2016)* 535–553 (2016).
RELEASE_NOTES.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Release notes
2
+
3
+ ## Revision `7ebdef3b61de34c733268e87b600d63d223d4f15` (1 May 2026)
4
+
5
+ The revision that the paper used. Files:
6
+
7
+ | File | Size (bytes) |
8
+ |---|---:|
9
+ | `config.json` | 607 |
10
+ | `configuration_spatial_embeddings.py` | 943 |
11
+ | `modeling_spatial_embeddings.py` | 7,969 |
12
+ | `model.safetensors.index.json` | 55,638 |
13
+ | `model-00001-of-00006.safetensors` | 4,980,242,800 |
14
+ | `model-00002-of-00006.safetensors` | 4,967,511,336 |
15
+ | `model-00003-of-00006.safetensors` | 4,967,511,704 |
16
+ | `model-00004-of-00006.safetensors` | 4,967,544,584 |
17
+ | `model-00005-of-00006.safetensors` | 4,967,544,456 |
18
+ | `model-00006-of-00006.safetensors` | 2,025,927,688 |
19
+
20
+ This revision also holds ten files whose names begin with `._` (4,096 bytes each). They
21
+ are metadata files that macOS wrote beside the files above when the model was uploaded.
22
+ They are not part of the model and nothing reads them.
23
+
24
+ ## Next revision (not published yet)
25
+
26
+ Adds the model card (`README.md`), the DINOv3 License (`LICENSE.md`), the MIT licence of
27
+ the two Python files (`LICENSE-MIT.txt`) and these notes, and removes the ten `._` files.
28
+ The weights, the configuration and the two Python files do not change. Code that names
29
+ the revision above keeps loading exactly the files of that revision.