Update README.md
Browse files
README.md
CHANGED
|
@@ -20,4 +20,38 @@ Meta AI (FAIR)
|
|
| 20 |
<ul>
|
| 21 |
<li><a href="https://github.com/facebookresearch/dinov2">Learn more</a></li>
|
| 22 |
<li><a href="https://github.com/facebookresearch/dinov2/blob/main/LICENSE">License</a></li>
|
| 23 |
-
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
<ul>
|
| 21 |
<li><a href="https://github.com/facebookresearch/dinov2">Learn more</a></li>
|
| 22 |
<li><a href="https://github.com/facebookresearch/dinov2/blob/main/LICENSE">License</a></li>
|
| 23 |
+
</ul>
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
# Vendored DINOv2 source
|
| 27 |
+
|
| 28 |
+
This repo bundles a slimmed copy of the DINOv2 architecture source alongside the model weights, so AddaxAI can load the architecture from this Hugging Face repo instead of fetching it from `github.com/facebookresearch/dinov2` at runtime.
|
| 29 |
+
|
| 30 |
+
This is needed because many AddaxAI users sit behind networks that allow `huggingface.co` but block or throttle GitHub, and the first run of the embedding step would otherwise fail with no internet access to github.com.
|
| 31 |
+
|
| 32 |
+
## What is included
|
| 33 |
+
|
| 34 |
+
Only the files needed to load the vits14, vitb14, and vitl14 backbones for inference:
|
| 35 |
+
|
| 36 |
+
- `hubconf.py` (slimmed to the three backbone entry points)
|
| 37 |
+
- `LICENSE` (Apache 2.0)
|
| 38 |
+
- `dinov2/__init__.py`
|
| 39 |
+
- `dinov2/hub/__init__.py`, `dinov2/hub/backbones.py`, `dinov2/hub/utils.py`
|
| 40 |
+
- `dinov2/models/__init__.py`, `dinov2/models/vision_transformer.py`
|
| 41 |
+
- `dinov2/layers/__init__.py` and the 7 layer files it imports
|
| 42 |
+
|
| 43 |
+
Training, evaluation, segmentation, depth, classifiers, cell-dino, xray-dino, and dinotxt code paths are not included.
|
| 44 |
+
|
| 45 |
+
## How it is loaded
|
| 46 |
+
|
| 47 |
+
AddaxAI calls:
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
torch.hub.load(model_dir, model_arch, source="local", pretrained=False)
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
where `model_dir` is the local directory the weights and these source files have been downloaded into via the Hugging Face Hub.
|
| 54 |
+
|
| 55 |
+
## License and provenance
|
| 56 |
+
|
| 57 |
+
DINOv2 is licensed under Apache 2.0. The original code lives at https://github.com/facebookresearch/dinov2. See the `LICENSE` file for the full text. No source-level modifications have been made to the vendored files except for `hubconf.py`, which was slimmed to only re-export the three entry points AddaxAI uses.
|