SharpAI commited on
Commit
e502ae5
·
verified ·
1 Parent(s): e2a92d7

Add dinov3_vits16 CoreML FP32 model (448×448)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ demo_image.png filter=lfs diff=lfs merge=lfs -text
37
+ dinov3_feature_comparison.png filter=lfs diff=lfs merge=lfs -text
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,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: coreml
3
+ tags:
4
+ - vision
5
+ - feature-extraction
6
+ - dinov3
7
+ - coreml
8
+ - apple-silicon
9
+ - fp32
10
+ pipeline_tag: feature-extraction
11
+ ---
12
+
13
+ # DINOv3 VITS16 CoreML FP32
14
+
15
+ CoreML conversion of [facebook/dinov3-vits16-pretrain-lvd1689m](https://huggingface.co/facebook/dinov3-vits16-pretrain-lvd1689m) optimized for Apple Silicon.
16
+
17
+ ## Model Details
18
+
19
+ - **Base Model**: facebook/dinov3-vits16-pretrain-lvd1689m
20
+ - **Framework**: CoreML
21
+ - **Precision**: FP32
22
+ - **Input Size**: 448×448
23
+ - **Model Size**: 82.9 MB
24
+
25
+ ## Usage
26
+
27
+ ### Python (CoreML)
28
+
29
+ ```python
30
+ import coremltools as ct
31
+ import numpy as np
32
+ from PIL import Image
33
+
34
+ # Load model
35
+ model = ct.models.MLModel("dinov3_vits16_448x448_fp32.mlpackage")
36
+
37
+ # Prepare image
38
+ image = Image.open("image.jpg").resize((448, 448))
39
+
40
+ # Extract features
41
+ output = model.predict({"image": image})
42
+ features = output["features"] # Shape: [1, embed_dim, grid_size, grid_size]
43
+ ```
44
+
45
+ ### Swift/iOS
46
+
47
+ ```swift
48
+ import CoreML
49
+
50
+ // Load model
51
+ guard let model = try? MLModel(contentsOf: modelURL) else {
52
+ fatalError("Failed to load model")
53
+ }
54
+
55
+ // Prepare image
56
+ guard let image = UIImage(named: "image.jpg") else {
57
+ fatalError("Failed to load image")
58
+ }
59
+
60
+ // Extract features
61
+ let input = try MLFeatureValue(image: image.cgImage!)
62
+ let output = try model.prediction(from: [input])
63
+ let features = output.featureValue(for: "features")?.multiArrayValue
64
+ ```
65
+
66
+ ## Performance
67
+
68
+ Performance metrics on Apple Silicon:
69
+
70
+ ### CoreML Performance
71
+
72
+ - **Throughput**: 32.15 FPS
73
+ - **Latency**: 31.10 ± 0.53 ms
74
+ - **Min Latency**: 30.57 ms
75
+ - **Max Latency**: 32.79 ms
76
+
77
+ ### Speedup vs PyTorch
78
+
79
+ - **PyTorch**: 19.33 FPS
80
+ - **CoreML**: 32.15 FPS
81
+ - **Speedup**: 1.66x faster ⚡
82
+
83
+ ### Feature Accuracy
84
+
85
+ - **Cosine Similarity**: 0.9847 (vs PyTorch)
86
+ - **Correlation**: 0.9847
87
+ - **Quality**: ⭐⭐⭐ Very Good - Excellent similarity
88
+
89
+ ### Model Specifications
90
+
91
+ - **Precision**: FP32
92
+ - **Input Size**: 448×448
93
+ - **Model Size**: 82.9 MB
94
+
95
+
96
+ ## License
97
+
98
+ This model is released under the DINOv3 License. See [LICENSE.md](LICENSE.md) for details.
99
+
100
+ ## Citation
101
+
102
+ ```bibtex
103
+ @article{dinov3,
104
+ title={DINOv3: A Versatile Vision Foundation Model},
105
+ author={Meta AI Research},
106
+ journal={arXiv preprint arXiv:2508.10104},
107
+ year={2025}
108
+ }
109
+ ```
110
+
111
+ **Reference**: [DINOv3 Paper](https://arxiv.org/pdf/2508.10104)
112
+
113
+ Key contributions:
114
+ - **Gram anchoring** strategy for high-quality dense feature maps
115
+ - Self-supervised learning on 1.689B images
116
+ - Superior performance on dense vision tasks
117
+ - Versatile across tasks and domains without fine-tuning
118
+
119
+ ## Demo Images
120
+
121
+ ### Input Image
122
+ <div align="center">
123
+ <img src="demo_image.png" alt="Demo Input Image" width="500"/>
124
+ </div>
125
+ *Sample input image for feature extraction demonstration*
126
+
127
+ ### Feature Visualization
128
+ <div align="center">
129
+ <img src="dinov3_feature_comparison.png" alt="Feature Comparison Visualization" width="800"/>
130
+ </div>
131
+
132
+ The visualization shows:
133
+ - **PCA projection** of high-dimensional features (RGB visualization)
134
+ - **Feature channel activations** showing spatial patterns
135
+ - **Gram matrix analysis** for object similarity detection
136
+ - **Side-by-side comparison** with PyTorch reference implementation
137
+
138
+ This comprehensive visualization demonstrates that CoreML conversion preserves the semantic structure and feature quality of the original DINOv3 model.
139
+
140
+ ## Powered By DINOv3
141
+
142
+ 🌟 **This model is powered by DINOv3** 🌟
143
+
144
+ Converted by [Aegis AI](https://github.com/Aegis-AI/Aegis-AI) for optimized Apple Silicon deployment.
145
+
146
+ ## Related Models
147
+
148
+ - Original PyTorch Model: [facebook/dinov3-vits16-pretrain-lvd1689m](https://huggingface.co/facebook/dinov3-vits16-pretrain-lvd1689m)
149
+ - DINOv3 License: https://ai.meta.com/resources/models-and-libraries/dinov3-license/
150
+
151
+ ---
152
+ *Last updated: 2025-10-31*
benchmark_results.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "pytorch": {
3
+ "fps": 19.332425263784515,
4
+ "avg_time": 0.05172656748211011,
5
+ "std_time": 0.0005012074449838314,
6
+ "min_time": 0.05101224998361431,
7
+ "max_time": 0.053992042026948184
8
+ },
9
+ "coreml": {
10
+ "fps": 32.15425560143712,
11
+ "avg_time": 0.03110008243995253,
12
+ "std_time": 0.0005346886997093497,
13
+ "min_time": 0.030570499977329746,
14
+ "max_time": 0.032787583011668175
15
+ },
16
+ "coreml_compute_units": {
17
+ "all": {
18
+ "fps": 32.15425560143712,
19
+ "avg_time": 0.03110008243995253,
20
+ "std_time": 0.0005346886997093497,
21
+ "min_time": 0.030570499977329746,
22
+ "max_time": 0.032787583011668175
23
+ },
24
+ "cpu_and_gpu": {
25
+ "fps": 32.20509249743861,
26
+ "avg_time": 0.031050989842042326,
27
+ "std_time": 0.0004550632317517775,
28
+ "min_time": 0.030179416004102677,
29
+ "max_time": 0.03201974998228252
30
+ },
31
+ "cpu_and_ne": {
32
+ "fps": 19.06985385844124,
33
+ "avg_time": 0.052438786758575585,
34
+ "std_time": 0.000377638568636697,
35
+ "min_time": 0.05188629199983552,
36
+ "max_time": 0.05374554201262072
37
+ },
38
+ "cpu_only": {
39
+ "fps": 19.221620435493886,
40
+ "avg_time": 0.052024750116979705,
41
+ "std_time": 0.0004059331112169348,
42
+ "min_time": 0.051470792008331046,
43
+ "max_time": 0.05362724998849444
44
+ }
45
+ },
46
+ "comparison": {
47
+ "cosine_similarity": 0.9847110509872437,
48
+ "l2_distance": 0.1632278561592102,
49
+ "correlation": 0.984681706507534
50
+ }
51
+ }
demo_image.png ADDED

Git LFS Details

  • SHA256: 84f76df27bc3f67833203919fa7639b436680854a7dbee5b5246507a386a8457
  • Pointer size: 131 Bytes
  • Size of remote file: 417 kB
dinov3_feature_comparison.png ADDED

Git LFS Details

  • SHA256: 6b4dd889115ee8a4b8cf3afc5d3010ca6b46248b507d1e5ffc973bb3d1ced260
  • Pointer size: 131 Bytes
  • Size of remote file: 860 kB
dinov3_vits16_448x448_fp32.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:808d63c6fc6ed3e959695a41cd4fb305f9737e03fdca6cc07397d0b0f1f39a26
3
+ size 191717
dinov3_vits16_448x448_fp32.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aec129f61a7aa8e5f5e1c967f7d17f6b6e47d60b0b5c1bda4163d7de5680c147
3
+ size 86762880
dinov3_vits16_448x448_fp32.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "988424F9-1194-4F62-ADBF-7B1AD0F8B119": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Weights",
7
+ "name": "weights",
8
+ "path": "com.apple.CoreML/weights"
9
+ },
10
+ "A5035703-0E2E-4F84-BF87-CF2F13E3A76F": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Specification",
13
+ "name": "model.mlmodel",
14
+ "path": "com.apple.CoreML/model.mlmodel"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "A5035703-0E2E-4F84-BF87-CF2F13E3A76F"
18
+ }