<commit_before>import cv2
from keras.models import load_model
import numpy as np
from statistics import mode
from utils import preprocess_input
from utils import get_labels

detection_model_path = '../trained_models/detection_models/haarcascade_frontalface_default.xml'
gender_model_path = '../trained_models/gender_models/simple_CNN.87-0.91.hdf5'
frame_window = 10
x_offset = 30
y_offset = 60
gender_labels = get_labels('imdb')

face_detection = cv2.CascadeClassifier(detection_model_path)
gender_classifier = load_model(gender_model_path)
label_window = []
video_capture = cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.startWindowThread()
cv2.namedWindow('window_frame')
while True:
    _, frame = video_capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
    faces = face_detection.detectMultiScale(gray, 1.3, 5)
    print(len(faces))
    for (x,y,w,h) in faces:
        cv2.rectangle(frame, (x - x_offset, y - y_offset),
                    (x + w + x_offset, y + h + y_offset),
                    (255, 0, 0), 2)
        face = frame[(y - y_offset):(y + h + y_offset),
                    (x - x_offset):(x + w + x_offset)]
        try:
            face = cv2.resize(face, (48, 48))
        except:<commit_msg>Deleted debug print from video_test.py<commit_after>import cv2
from keras.models import load_model
import numpy as np
from statistics import mode
from utils import preprocess_input
from utils import get_labels

detection_model_path = '../trained_models/detection_models/haarcascade_frontalface_default.xml'
gender_model_path = '../trained_models/gender_models/simple_CNN.87-0.91.hdf5'
frame_window = 10
x_offset = 30
y_offset = 60
gender_labels = get_labels('imdb')

face_detection = cv2.CascadeClassifier(detection_model_path)
gender_classifier = load_model(gender_model_path)
label_window = []
video_capture = cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.startWindowThread()
cv2.namedWindow('window_frame')
while True:
    _, frame = video_capture.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
    faces = face_detection.detectMultiScale(gray, 1.3, 5)
    for (x,y,w,h) in faces:
        cv2.rectangle(frame, (x - x_offset, y - y_offset),
                    (x + w + x_offset, y + h + y_offset),
                    (255, 0, 0), 2)
        face = frame[(y - y_offset):(y + h + y_offset),
                    (x - x_offset):(x + w + x_offset)]
        try:
            face = cv2.resize(face, (48, 48))
        except:
{'fraction_non_alphanumeric': 0.11102514506769826, 'fraction_numerical': 0.030947775628626693, 'mean_word_length': 3.481802426343154, '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': '3695698', 'n_tokens_mistral': 951, 'n_tokens_neox': 895, 'n_words': 190}