We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 795087b commit fb7e7d2Copy full SHA for fb7e7d2
Section #3 - Faces/faces_train.py
@@ -21,6 +21,9 @@ def create_train():
21
img_path = os.path.join(path,img)
22
23
img_array = cv.imread(img_path)
24
+ if img_array is None:
25
+ continue
26
+
27
gray = cv.cvtColor(img_array, cv.COLOR_BGR2GRAY)
28
29
faces_rect = haar_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=4)
@@ -43,4 +46,4 @@ def create_train():
43
46
44
47
face_recognizer.save('face_trained.yml')
45
48
np.save('features.npy', features)
-np.save('labels.npy', labels)
49
+np.save('labels.npy', labels)
0 commit comments