Spaces:
Sleeping
Sleeping
Commit ·
c0e5eb5
1
Parent(s): c5f48f5
fix readme.md
Browse files12345618910111213141523import torch
# Add this before YOLO loadingtorch.serialization.weights_only = False # if needed globally
# Or patch locally in ultralytics code (best practice)from ultralytics import YOLOmodelYolo_path = 'path/to/your/model.pt'
# Use this context manager to trust and allow the custom classfrom torch.serialization import safe_globalsfrom ultralytics.nn.tasks import DetectionModel
with safe_globals([DetectionModel]): faceDetector = YOLO(modelYolo_path)modelYolo_path = "weights/yolov8n-face.pt"faceDetector = YOLO(modelYolo_path)faceDetect.py+2-14