Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1 |
-
---
|
2 |
-
license: cc-by-nc-3.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-3.0
|
3 |
+
library_name: torchgeo
|
4 |
+
---
|
5 |
+
|
6 |
+
Rehosted and modified from https://huggingface.co/gajeshladhar/core-dino
|
7 |
+
|
8 |
+
Modified using the following code:
|
9 |
+
|
10 |
+
```python
|
11 |
+
import os
|
12 |
+
import hashlib
|
13 |
+
|
14 |
+
import torch
|
15 |
+
import ultralytics
|
16 |
+
|
17 |
+
model = ultralytics.YOLO("yolo11x.yaml")
|
18 |
+
ckpt = "https://huggingface.co/gajeshladhar/core-dino/resolve/main/checkpoints/student.pt"
|
19 |
+
ckpt = torch.hub.load_state_dict_from_url(ckpt, map_location='cpu')
|
20 |
+
model.model.load_state_dict(
|
21 |
+
{k.replace('layers.', 'model.'): v for k, v in ckpt.items()},
|
22 |
+
strict=False)
|
23 |
+
|
24 |
+
model.ckpt = model.state_dict()
|
25 |
+
|
26 |
+
filename = "yolo11x_rgb_core_dino.pt"
|
27 |
+
model.save(filename)
|
28 |
+
md5 = hashlib.md5(open(filename, "rb").read()).hexdigest()[:8]
|
29 |
+
os.rename(filename, filename.replace(".pt", f"-{md5}.pt"))
|
30 |
+
```
|