FIx downstream impact by the replacement of torch.load in ultralytics package (#13623)
* Update torch_load * Auto-format by https://ultralytics.com/actions --------- Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
1 parent
79c4c31d16
commit
2540fd4c1c
9 files changed
+20
-12
No files matched your search
@@ -1128,10 +1128,11 @@ def pipeline_coreml(model, im, file, names, y, mlmodel, prefix=colorstr("CoreML
|
||||
|
||||
Examples:
|
||||
```python
|
||||
from ultralytics.utils.patches import torch_load
|
||||
from pathlib import Path
|
||||
import torch
|
||||
|
||||
model = torch.load('yolov5s.pt') # Load YOLOv5 model
|
||||
model = torch_load('yolov5s.pt') # Load YOLOv5 model
|
||||
im = torch.zeros((1, 3, 640, 640)) # Example input tensor
|
||||
|
||||
names = {0: "person", 1: "bicycle", 2: "car", ...} # Define class names
|
||||
|
||||
Reference in new issue
Block a user