{"id":308203,"date":"2020-08-09T15:00:28","date_gmt":"2020-08-09T15:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308203"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-08-09T15:00:28","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308203","title":{"rendered":"\u041a\u0430\u043a \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0445\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/514414\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jp\/lf\/yy\/jplfyytwllkovstnqxgso45aii4.jpeg\"\/><\/p>\n<p>  \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043f\u0435\u0434\u0430\u0433\u043e\u0433\u043e\u043c \u0432 \u0434\u0435\u0442\u0441\u043a\u043e\u043c \u0442\u0435\u0445\u043d\u043e\u043f\u0430\u0440\u043a\u0435 \u00ab\u041a\u0432\u0430\u043d\u0442\u043e\u0440\u0438\u0443\u043c\u00bb. \u0412 \u043f\u0435\u0440\u0438\u043e\u0434 \u0441\u0430\u043c\u043e\u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u044b \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435. \u0418 \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0435\u0442\u0438 \u0441\u0442\u0430\u043b\u0438 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c, \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0435\u0448\u0438\u043b\u0430 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0447\u0430\u0441 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u044b\u0432\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 (\u0447\u0442\u043e \u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u0440\u0435\u043d\u0438\u0435). \u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c, \u0432\u0435\u0434\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 excel (\u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439) \u0438 \u0432\u044b\u0434\u0430\u0435\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u044b\u0432.<\/p>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0437\u0430 \u043f\u043a \u0438 \u0445\u043e\u0447\u0435\u0442 \u0432\u043e\u0433\u043d\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u043c\u043a\u0438 \u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0442\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0436\u0438\u0437\u043d\u0438 \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435.<\/p>\n<p>  <a href=\"https:\/\/github.com\/evg-voronov\/chasovoy\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a><\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<ul>\n<li>\u0434\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u043b\u0438\u0446\u0430 \u0447\u0435\u0440\u0435\u0437 web \u043a\u0430\u043c\u0435\u0440\u0443 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c mtcnn);<\/li>\n<li>\u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 time)<\/li>\n<li>\u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 excel \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 openpyxl);<\/li>\n<li>\u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435;<\/li>\n<li>\u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u041f\u041a.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u0414\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u043b\u0438\u0446\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c web \u043a\u0430\u043c\u0435\u0440\u044b<\/h3>\n<p>  \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c \u043f\u043e \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u043c\u044b\u0448\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0438 web \u043a\u0430\u043c\u0435\u0440\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u0438\u043b\u0438 youtube \u0440\u043e\u043b\u0438\u043a\u043e\u0432, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u0446 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u043b\u0438\u0446\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 mtcnn. \u0413\u043e\u043b\u043e\u0432\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434 \u043b\u044e\u0431\u044b\u043c \u0443\u0433\u043b\u043e\u043c, \u0432 \u043e\u0447\u043a\u0430\u0445, \u043f\u0440\u0438 \u043f\u043b\u043e\u0445\u043e\u043c \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043b\u0438\u0446\u043e \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043a\u0430\u0434\u0440 \u0438\u043b\u0438 \u043f\u0440\u0438\u043a\u0440\u044b\u0442\u043e \u0440\u0443\u043a\u043e\u0439, \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e. \u0421\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0435\u0435 \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0448\u0438\u0442 \u043d\u0430\u0448\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u0412\u0438\u043e\u043b\u044b-\u0414\u0436\u043e\u043d\u0441\u0430. \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0445\u0443\u0436\u0435, \u0447\u0435\u043c \u0443 mtcnn, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0442\u0430\u043a\u0436\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p5\/rj\/rv\/p5rjrv-oxr4rhmruifew3r3h1ka.png\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/it\/oy\/tu\/itoytuwqihq8hruzzqwofztuzf4.png\"\/><\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435.<\/p>\n<pre><code class=\"python\">import cv2 import os from mtcnn.mtcnn import MTCNN   def show_face_frame():     if faces:         bounding_box = faces[0]['box']         keypoints = faces[0]['keypoints']         cv2.rectangle(img,                       (bounding_box[0], bounding_box[1]),                       (bounding_box[0] + bounding_box[2],                        bounding_box[1] + bounding_box[3]),                       (0, 0, 255),                       2)         cv2.circle(img, (keypoints['left_eye']), 3, (0, 0, 255), 2)         cv2.circle(img, (keypoints['right_eye']), 2, (0, 0, 255), 2)         cv2.circle(img, (keypoints['nose']), 3, (0, 0, 255), 2)         cv2.circle(img, (keypoints['mouth_left']), 3, (0, 0, 255), 2)         cv2.circle(img, (keypoints['mouth_right']), 3, (0, 0, 255), 2)     cv2.imshow('frame', img)  cap = cv2.VideoCapture(0) detector = MTCNN()  while cap.isOpened():         _, img = cap.read()         img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)         faces = detector.detect_faces(img)         show_face_frame()         cv2.waitKey(300)  cap.release() cv2.destroyAllWindows() <\/code><\/pre>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 <strong>cv2.waitKey(300)<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 3-4 \u043a\u0430\u0434\u0440\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442 i3-8145U \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043d\u0430 15%.<\/p>\n<h3>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/h3>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445:<\/p>\n<ul>\n<li>\u0441\u0435\u043b \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043d\u0430 5 \u0441\u0435\u043a \u0447\u0442\u043e-\u0442\u043e \u043f\u043e \u0431\u044b\u0440\u0438\u043a\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c;<\/li>\n<li>\u0432\u044b\u0448\u0435\u043b \u043d\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u0444\u0435 \u0438\u043b\u0438 \u0440\u0430\u0437\u043c\u044f\u0442\u044c \u043d\u043e\u0433\u0438.<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440\u0430 <strong>time_here<\/strong> (\u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u043b\u0438\u0446\u043e \u0432 \u043a\u0430\u0434\u0440\u0435) \u0438 <strong>time_not_here<\/strong> (\u043a\u043e\u0433\u0434\u0430 \u043b\u0438\u0446\u0430 \u043d\u0435\u0442). \u041e\u0431\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440\u0430 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 <strong>time_not_here<\/strong> \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043b\u0438\u0446\u043e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0434\u0440\u0435.<\/p>\n<p>  \u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>min_time_here<\/strong> \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b. \u0417\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043e\u0442\u0432\u043b\u0435\u0447\u0451\u0442\u0441\u044f \u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0447\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <strong>min_time_not_here<\/strong>.<\/p>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u043b \u043c\u0438\u043d\u0438\u043c\u0443\u043c 5 \u043c\u0438\u043d\u0443\u0442 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u044f \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u044e\u0441\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u043d\u0430 2 \u043c\u0438\u043d\u0443\u0442\u044b.<\/p>\n<pre><code class=\"python\">import cv2 import time import os from mtcnn.mtcnn import MTCNN  cap = cv2.VideoCapture(0) path = os.path.abspath(__file__)[:-11]  # \u0438\u0437 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430  here, not_here = 0, 0  # \u0441\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440\u044b time_here, time_not_here = 0, 0  # \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 switch = True  # \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0435\u0441\u0442\u044c \u043b\u0438\u0446\u043e \u0432 \u043a\u0430\u0434\u0440\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442 min_time_here = 300  # \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0437\u0430 \u043f\u043a, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c (\u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445)  min_time_not_here = 120  # \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 (\u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445)  detector = MTCNN()  try:     while cap.isOpened():         _, img = cap.read()         img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)         faces = detector.detect_faces(img)        show_face_frame()        audio_message(path, here)          if faces and switch:             not_here = 0             switch = False             if here == 0:                 here = time.time()                 print('\u0432\u044b \u0441\u0435\u043b\u0438 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0432 ' + time.strftime(&quot;%H:%M:%S&quot;, time.localtime(here)))         elif not faces and not switch:             not_here = time.time()             switch = True          if not_here != 0:             time_not_here = time.time() - not_here         if here != 0 and not switch:             time_here = time.time() - here          if time_here &gt; min_time_here and time_not_here &gt; min_time_not_here:  # \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0437\u0430 \u041f\u041a \u0431\u043e\u043b\u044c\u0448\u0435 min_time_here             write_excel(path, here)             print('\u0432\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c ' + time.strftime('%H:%M:%S', time.gmtime(time.time() - here)))             time_here, time_not_here = 0, 0             here, not_here = 0, 0         elif time_not_here &gt; min_time_not_here and  time_here &lt; min_time_here:  # \u0435\u0441\u043b\u0438 \u0437\u0430 \u041f\u041a \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 min_time_here, \u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c             print('\u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430')             time_here, time_not_here = 0, 0             here, not_here = 0, 0          cv2.waitKey(300) except KeyboardInterrupt:     if time_here &gt; min_time_here:  # \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0437\u0430 \u041f\u041a \u0431\u043e\u043b\u044c\u0448\u0435 min_time_here         write_excel(path, here)     cap.release()     cv2.destroyAllWindows() <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0447\u0435\u0442 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (ctrl+c) \u0438 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 excel \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442<\/h3>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 excel \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 openpyxl, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043b\u0438\u0441\u0442 \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0430\u0442\u043e\u0439.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ye\/k-\/bu\/yek-bujrnuv9kvwpyiqr6-nyrqg.png\" \/><\/div>\n<p>  \u041d\u0430 1 \u043b\u0438\u0441\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0443\u0442\u043e\u0447\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0434\u0435\u043d\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bi\/w9\/x_\/biw9x_hokax4tpfybaxc_hbjqei.png\"\/><\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>write_excel<\/strong> \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442.<\/p>\n<p>  \u041d\u0435\u043b\u044c\u0437\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 openpyxl \u0435\u0441\u043b\u0438 \u043e\u043d \u0443\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"python\">def write_excel(path_excel, time_start):     wb = openpyxl.load_workbook(path_excel + r'\\dnevnik.xlsx')     today = time.strftime(&quot;%d.%m.%Y&quot;, time.localtime(time.time()))     if today not in wb.sheetnames:  # \u0435\u0441\u043b\u0438 \u043b\u0438\u0441\u0442\u0430 \u0441 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u0439 \u0434\u0430\u0442\u043e\u0439 \u0435\u0449\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e         wb.create_sheet(title=today)         sheet = wb[today]         sheet.column_dimensions['A'].width = 20         sheet.column_dimensions['B'].width = 20         sheet.column_dimensions['C'].width = 20         sheet.column_dimensions['D'].width = 31         sheet['A1'] = '\u041d\u0430\u0447\u0430\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 \u041f\u041a'         sheet['B1'] = '\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430 \u041f\u041a'         sheet['C1'] = '\u0417\u0430\u043a\u043e\u043d\u0447\u0438\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c'         sheet['D1'] = '\u0421\u0435\u043b \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440:'         sheet['D2'] = '\u0412\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0437\u0430 \u041f\u041a \u0432\u0440\u0435\u043c\u0435\u043d\u0438:'         sheet = wb[today]         row = 2         all_time = 0     else:  # \u0435\u0441\u043b\u0438 \u043b\u0438\u0441\u0442 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e         sheet = wb[today]         row = sheet['E1'].value  # \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 excel \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435         all_time = sheet['E2'].value  # \u043e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0437\u0430 \u041f\u041a \u0437\u0430 \u043e\u0434\u0438\u043d \u0434\u0435\u043d\u044c         all_time = all_time.split(':')         all_time = int(all_time[0]) * 3600 + int(all_time[1]) * 60 + int(all_time[2])  # \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u044b         row = row + 2  # \u043f\u043b\u044e\u0441\u0443\u0435\u043c \u0448\u0430\u043f\u043a\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443      sheet['A' + str(row)] = time.strftime(&quot;%H:%M:%S&quot;, time.localtime(time_start))  # \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u043b\u0438 \u0437\u0430 \u043f\u043a     sheet['C' + str(row)] = time.strftime(&quot;%H:%M:%S&quot;, time.localtime(time.time()))  # \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0437\u0430 \u043f\u043a     seconds = time.time() - time_start  # \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c     sheet['B' + str(row)] = time.strftime('%H:%M:%S', time.gmtime(seconds))     sheet['E1'] = row - 1  # \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0448\u0430\u043f\u043a\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443     all_time = all_time + seconds     all_time = time.strftime('%H:%M:%S', time.gmtime(all_time))     sheet['E2'] = all_time     # \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u043b\u0438\u0441\u0442     sheet_0 = wb.worksheets[0]     sheet_0['A' + str(len(wb.sheetnames))] = today     sheet_0['B' + str(len(wb.sheetnames))] = all_time     while True:  # \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b         try:             wb.save(path_excel + r'\\dnevnik.xlsx')         except PermissionError:             input('\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 excel \u0444\u0430\u0439\u043b \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043d\u0430\u0436\u0430\u0432 enter')         else:             break <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0417\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 8 \u0430\u0443\u0434\u0438\u043e\u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/apihost.ru\/voice\">\u0441\u0438\u043d\u0442\u0435\u0437\u0430\u0442\u043e\u0440 \u0440\u0435\u0447\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0447\u0430\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0440\u044b\u0432 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0445 \u0437\u0432\u0443\u043a\u043e\u0432\u044b\u0445 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. <\/p>\n<pre><code class=\"python\">def audio_message(path, here):     if here == 0:         pass     elif time.strftime('%H:%M:%S', time.gmtime(time.time()-here)) == &quot;01:00:00&quot;:         wav = random.choice(os.listdir(path + r'\\audio'))         winsound.PlaySound(path + r'\\audio\\\\' + wav, winsound.SND_FILENAME) <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u041f\u041a<\/h3>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0430\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0432\u0438\u043d\u0434\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0442\u043d\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c python \u0441\u043a\u0440\u0438\u043f\u0442. \u0411\u0430\u0442\u043d\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438:<\/p>\n<p>  <em>C:\\Users\\%username%\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup<\/em><\/p>\n<p>  C \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u0430\u0442\u043d\u0438\u043a \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u0445, \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>os.getcwd()<\/strong> \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u0431\u0430\u0442\u043d\u0438\u043a\u0430. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <strong>os.path.abspath(__file__)[:-11] <\/strong><\/p>\n<h3>\u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c<\/h3>\n<p>  \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043b\u0435\u0434\u0438\u043b\u0430 \u0437\u0430 \u043c\u043e\u0438\u043c \u043b\u0438\u0446\u043e\u043c, \u0430 \u043d\u0435 \u0437\u0430 \u0432\u0441\u0435\u043c\u0438, \u043a\u0442\u043e \u0441\u0430\u0434\u0438\u0442\u044c\u0441\u044f \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f FaceNet \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043b\u0438\u0446\u0430.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u043f\u043b\u0430\u043d\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0438 \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0430 \u043d\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f.<br \/>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043b\u0438 \u043d\u0430 <a href=\"https:\/\/www.linkedin.com\/in\/evg-voronov\/\">https:\/\/www.linkedin.com\/in\/evg-voronov\/<\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/514414\/\"> https:\/\/habr.com\/ru\/post\/514414\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/514414\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jp\/lf\/yy\/jplfyytwllkovstnqxgso45aii4.jpeg\"\/><\/p>\n<p>  \u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043f\u0435\u0434\u0430\u0433\u043e\u0433\u043e\u043c \u0432 \u0434\u0435\u0442\u0441\u043a\u043e\u043c \u0442\u0435\u0445\u043d\u043e\u043f\u0430\u0440\u043a\u0435 \u00ab\u041a\u0432\u0430\u043d\u0442\u043e\u0440\u0438\u0443\u043c\u00bb. \u0412 \u043f\u0435\u0440\u0438\u043e\u0434 \u0441\u0430\u043c\u043e\u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u043c\u044b \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043d\u0430 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435. \u0418 \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0435\u0442\u0438 \u0441\u0442\u0430\u043b\u0438 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c, \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0435\u0448\u0438\u043b\u0430 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0447\u0430\u0441 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u044b\u0432\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0439 (\u0447\u0442\u043e \u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u0440\u0435\u043d\u0438\u0435). \u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f, \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0437\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u043c, \u0432\u0435\u0434\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 excel (\u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439) \u0438 \u0432\u044b\u0434\u0430\u0435\u0442 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0440\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u044b\u0432.<\/p>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u0437\u0430 \u043f\u043a \u0438 \u0445\u043e\u0447\u0435\u0442 \u0432\u043e\u0433\u043d\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u043c\u043a\u0438 \u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0442\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0436\u0438\u0437\u043d\u0438 \u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435.<\/p>\n<p>  <a href=\"https:\/\/github.com\/evg-voronov\/chasovoy\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a><\/p>\n<p>  \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-308203","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308203"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308203\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}