|
--- |
|
license: cc-by-nc-3.0 |
|
library_name: torchgeo |
|
--- |
|
|
|
Rehosted and modified from https://huggingface.co/gajeshladhar/core-dino |
|
|
|
Modified using the following code: |
|
|
|
```python |
|
import os |
|
import hashlib |
|
|
|
import torch |
|
import ultralytics |
|
|
|
model = ultralytics.YOLO("yolo11x.yaml") |
|
ckpt = "https://huggingface.co/gajeshladhar/core-dino/resolve/main/checkpoints/student.pt" |
|
ckpt = torch.hub.load_state_dict_from_url(ckpt, map_location='cpu') |
|
model.model.load_state_dict( |
|
{k.replace('layers.', 'model.'): v for k, v in ckpt.items()}, |
|
strict=False) |
|
|
|
model.ckpt = model.state_dict() |
|
|
|
filename = "core_dino_rgb_yolo11x.pt" |
|
model.save(filename) |
|
md5 = hashlib.md5(open(filename, "rb").read()).hexdigest()[:8] |
|
os.rename(filename, filename.replace(".pt", f"-{md5}.pt")) |
|
``` |