Spaces:
Sleeping
Sleeping
Commit ·
c0e5eb5
1
Parent(s): c5f48f5
fix readme.md
Browse files123456789101112131415import 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 DetectionModelwith safe_globals([DetectionModel]):faceDetector = YOLO(modelYolo_path)123from ultralytics import YOLOmodelYolo_path = "weights/yolov8n-face.pt"faceDetector = YOLO(modelYolo_path)
faceDetect.py+2-14