Spaces:
Running
on
Zero
Running
on
Zero
File size: 319 Bytes
0fc5095 |
1 2 3 4 5 6 7 8 9 10 |
import torch
from ultralytics.nn.tasks import DetectionModel
from safetensors.torch import load_file
tensor_dict = load_file("weights/icon_detect/model.safetensors")
model = DetectionModel('weights/icon_detect/model.yaml')
model.load_state_dict(tensor_dict)
torch.save({'model':model}, 'weights/icon_detect/best.pt')
|