Ryan Ramos
commited on
Commit
•
11c16d6
1
Parent(s):
c28b362
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
Weights converted from the official [DINO ResNet](https://github.com/facebookresearch/dino#pretrained-models-on-pytorch-hub) using [this script](https://colab.research.google.com/drive/1Ax3IDoFPOgRv4l7u6uS8vrPf4TX827BK?usp=sharing).
|
2 |
|
3 |
-
For up-to-date model card information, please see the [original repo](https://github.com/facebookresearch/dino).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- dino
|
4 |
+
- vision
|
5 |
+
|
6 |
+
datasets:
|
7 |
+
- imagenet-1k
|
8 |
+
---
|
9 |
+
|
10 |
+
# DINO ResNet-50
|
11 |
+
|
12 |
+
ResNet-50 pretrained with DINO. DINO was introduced in [Emerging Properties in Self-Supervised Vision Transformers](https://arxiv.org/abs/2104.14294), while ResNet was introduced in [Deep Residual Learning for Image Recognition](https://arxiv.org/abs/1512.03385). The official implementation of a DINO Resnet-50 can be found [here](https://github.com/facebookresearch/dino).
|
13 |
+
|
14 |
Weights converted from the official [DINO ResNet](https://github.com/facebookresearch/dino#pretrained-models-on-pytorch-hub) using [this script](https://colab.research.google.com/drive/1Ax3IDoFPOgRv4l7u6uS8vrPf4TX827BK?usp=sharing).
|
15 |
|
16 |
+
For up-to-date model card information, please see the [original repo](https://github.com/facebookresearch/dino).
|
17 |
+
|
18 |
+
### How to use
|
19 |
+
|
20 |
+
```python
|
21 |
+
from transformers import AutoFeatureExtractor, ResNetModel
|
22 |
+
from PIL import Image
|
23 |
+
import requests
|
24 |
+
|
25 |
+
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
26 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
27 |
+
|
28 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained('microsoft/resnet-50')
|
29 |
+
model = ResNetModel.from_pretrained('Ramos-Ramos/dino-resnet-50')
|
30 |
+
inputs = feature_extractor(images=image, return_tensors="pt")
|
31 |
+
outputs = model(**inputs)
|
32 |
+
last_hidden_states = outputs.last_hidden_state
|
33 |
+
```
|
34 |
+
|
35 |
+
### BibTeX entry and citation info
|
36 |
+
|
37 |
+
```bibtex
|
38 |
+
@article{DBLP:journals/corr/abs-2104-14294,
|
39 |
+
author = {Mathilde Caron and
|
40 |
+
Hugo Touvron and
|
41 |
+
Ishan Misra and
|
42 |
+
Herv{\'{e}} J{\'{e}}gou and
|
43 |
+
Julien Mairal and
|
44 |
+
Piotr Bojanowski and
|
45 |
+
Armand Joulin},
|
46 |
+
title = {Emerging Properties in Self-Supervised Vision Transformers},
|
47 |
+
journal = {CoRR},
|
48 |
+
volume = {abs/2104.14294},
|
49 |
+
year = {2021},
|
50 |
+
url = {https://arxiv.org/abs/2104.14294},
|
51 |
+
archivePrefix = {arXiv},
|
52 |
+
eprint = {2104.14294},
|
53 |
+
timestamp = {Tue, 04 May 2021 15:12:43 +0200},
|
54 |
+
biburl = {https://dblp.org/rec/journals/corr/abs-2104-14294.bib},
|
55 |
+
bibsource = {dblp computer science bibliography, https://dblp.org}
|
56 |
+
}
|
57 |
+
```
|
58 |
+
|
59 |
+
```bibtex
|
60 |
+
@inproceedings{he2016deep,
|
61 |
+
title={Deep residual learning for image recognition},
|
62 |
+
author={He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian},
|
63 |
+
booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
|
64 |
+
pages={770--778},
|
65 |
+
year={2016}
|
66 |
+
}
|
67 |
+
```
|