import cv2 video_path = 'video.mp4' # Video dosyasının yolu cap = cv2.VideoCapture('kaka.mp4') face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') while True: ret, img = cap.read() if not ret: break gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = face_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5) for (x, y, w, h) in faces: cv2.rectangle(img, (x, y), (x + w, y + h), (25, 0, 0), 3) cv2.putText(img, 'kovak', (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (25, 250, 0), 2) cv2.imshow('Yuz Tespiti', img) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()