Skip to content

Commit f23a567

Browse files
committed
Merge branch 4.x
2 parents 96257c2 + 9e13469 commit f23a567

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/face/samples/landmarks_demo.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
print("cascade not found")
1919
exit()
2020
faces = cascade.detectMultiScale(frame, 1.05, 3, cv.CASCADE_SCALE_IMAGE, (30, 30))
21-
ok, landmarks = facemark.fit(frame, faces=faces)
21+
if len(faces) == 0:
22+
print('no faces detected')
23+
landmarks = []
24+
else:
25+
ok, landmarks = facemark.fit(frame, faces=faces)
2226
cv.imshow("Image", frame)
2327
for marks in landmarks:
2428
couleur = (random.randint(0,255),

0 commit comments

Comments
 (0)