face.py 479 B

123456789101112
  1. from ultralytics import YOLO
  2. # Load model
  3. model = YOLO('yolov8m-face.pt')
  4. #model = YOLO('path/to/best.pt') # Load a custom trained model
  5. # Perform tracking with the model
  6. results = model.predict(source=0, show=True) #
  7. #results = model.track(source="https://www.youtube.com/watch?v=6n5d1C1Alh4", show=True) # Tracking with default tracker
  8. #results = model.track(source="https://youtu.be/LNwODJXcvt4", show=True, tracker="bytetrack.yaml") # Tracking with ByteTrack tracker