<commit_before>#!/usr/bin/env python
# -*- coding: utf8 -*-
"""face detecting using opencv"""
import cv2
# import video


def main():
    """Main function"""
    cap = cv2.VideoCapture(0)
    detectorLocation = '../haarcascades/haarcascade_frontalface_default.xml'
    face_cascade = cv2.CascadeClassifier(detectorLocation)
    flags = cv2.cv.CV_HAAR_SCALE_IMAGE
    while True:
        # Capture frame-by-frame
        ret, frame = cap.read()
        # Display the resulting frame
        gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
        # gray = cv2.equalizeHist(gray)
        faces = face_cascade.detectMultiScale(gray, 1.1, 5)
        for (x, y, w, h) in faces:
            cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
        cv2.imshow('frame', frame)
        if cv2.waitKey(1) == ord('q'):
            break
    cap.release()
    cv2.destroyAllWindows()

if __name__ == '__main__':
    main()<commit_msg>Trying to add beep sound<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
"""face detecting using opencv"""
import cv2
import Tkinter
# import video


def main():
    """Main function"""
    cap = cv2.VideoCapture(0)
    detectorLocation = '../haarcascades/haarcascade_frontalface_default.xml'
    face_cascade = cv2.CascadeClassifier(detectorLocation)
    flags = cv2.cv.CV_HAAR_SCALE_IMAGE
    while True:
        # Capture frame-by-frame
        ret, frame = cap.read()
        # Display the resulting frame
        gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
        # gray = cv2.equalizeHist(gray)
        faces = face_cascade.detectMultiScale(gray, 1.1, 5)
        if faces != ():
            Tkinter.Tk().bell()
        for (x, y, w, h) in faces:
            cv2.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
        cv2.imshow('frame', frame)
        if cv2.waitKey(1) == ord('q'):
            break
    cap.release()
    cv2.destroyAllWindows()

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.14278350515463917, 'fraction_numerical': 0.024742268041237112, 'mean_word_length': 2.607806691449814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '303419', 'n_tokens_mistral': 700, 'n_tokens_neox': 677, 'n_words': 152}