{"id":473134,"date":"2025-09-02T15:33:24","date_gmt":"2025-09-02T15:33:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=473134"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=473134","title":{"rendered":"<span>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u043a\u0430 \u043f\u0440\u0438 3d \u043f\u0435\u0447\u0430\u0442\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435, &#8212; creality K1C \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d \u043a\u0430\u043c\u0435\u0440\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0435\u0447\u0430\u0442\u0438. \u0423\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435. \u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0447\u0430\u0441\u0430\u043c\u0438 \u043a\u0430\u043a \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0434\u043e\u0435\u0434\u0430\u0435\u0442. \u0412\u0434\u0432\u043e\u0439\u043d\u0435 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0435\u0447\u0430\u0442\u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b \u043f\u043e \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0438 \u043f\u0435\u0447\u0430\u0442\u044c \u043d\u0435 \u0431\u044b\u043b\u0430 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430.  \u041a\u0430\u043a \u0440\u0430\u0437 \u043e \u0440\u0430\u043d\u043d\u0435\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0435\u0447\u0430\u0442\u0438 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0431\u0440\u0430\u043a\u0430 \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c.<\/p>\n<p>Creality \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0432 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0440\u0430\u043d\u043d\u0435\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0435\u0447\u0430\u0442\u0438,  \u0438 \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u0434\u0430\u0436\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438: \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432 \u043f\u0435\u0447\u0430\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u043e\u0440\u0432\u0430\u043b\u0430\u0441\u044c \u043e\u0442 \u0441\u0442\u043e\u043b\u0430, \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u0430\u043f\u043b\u044b\u0432 (blob) \u0438\u043b\u0438 \u0436\u0435 \u043f\u0440\u0438\u043d\u0442\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u043b \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c &#171;\u043c\u0430\u043a\u0430\u0440\u043e\u043d\u044b&#187; \u043d\u0438 \u0441 \u0442\u043e\u0433\u043e, \u043d\u0438 \u0441 \u0441\u0435\u0433\u043e. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430, \u043a\u0430\u043c\u0435\u0440\u0430 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a \u0432 \u0441\u0435\u0442\u044c.<\/p>\n<p>\u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 \u043f\u0440\u0438\u043d\u0442\u0435\u0440 \u043a\u0430\u043c\u0435\u0440\u0430, &#171;\u043e\u0442\u0434\u0430\u0435\u0442&#187; \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a \u043f\u043e http (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#8212; <a href=\"http:\/\/192.168.1.114:8080\/?action=stream\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.1.114:8080\/?action=stream<\/a>) \u0438 \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0443\u043b\u0435\u0442\u0430\u044e\u0449\u0438\u0435 \u0432 \u0440\u043e\u0434\u043d\u043e\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 creality. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438\u0434\u0443\u0442 \u0442\u0443\u0434\u0430.<\/p>\n<p>\u0412\u0441\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e &#8212; &#171;\u0447\u0438\u0442\u0430\u0442\u044c&#187; \u043a\u0430\u0434\u0440\u044b \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0438, \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c email \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435. \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u0442\u043e\u0438\u0442 &#8212; \u0431\u044b\u0432\u0430\u0435\u0442 \u0438 \u043d\u0430 &#171;\u0441\u0442\u0430\u0440\u0443\u0445\u0443 \u043f\u0440\u043e\u0440\u0443\u0445\u0430&#187; &#8212; \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430.<\/p>\n<h4>\u041a\u0430\u043a \u0436\u0435 \u0431\u0435\u0437 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438.<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c. yolov8 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0435 \u0432\u0437\u044f\u0442\u044c \u0438\u0437 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 yolo.<br \/> \u0414\u0430\u0442\u0430\u0441\u0435\u0442 (\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d \u043a \u0441\u0442\u0430\u0442\u044c\u0435), \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0432\u0437\u044f\u0442 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043d\u0430 roboflow. \u0412 \u043d\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0441 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044f\u043c\u0438: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rw\/cb\/pj\/rwcbpjpkr9znzb5vk3uhdtsomrm.jpeg\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/rw\/cb\/pj\/rwcbpjpkr9znzb5vk3uhdtsomrm.jpeg 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/rw\/cb\/pj\/rwcbpjpkr9znzb5vk3uhdtsomrm.jpeg 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 &#171;\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435&#187; \u0434\u043b\u044f yolo-detect \u043c\u043e\u0434\u0435\u043b\u0435\u0439:<br \/> <code>yolo task=detect mode=train model=yolov8s.pt imgsz=640 data=spagetti\\data.yaml epochs=10 batch=8 name=yolov8n_custom<\/code><br \/> \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f &#171;s&#187; \u043c\u043e\u0434\u0435\u043b\u044c 8\u0439 yolo \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 10 \u044d\u043f\u043e\u0445. \u0415\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c, &#171;s&#187; \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 &#171;l&#187; \u0438\/\u0438\u043b\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043f\u043e\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041a\u0430\u043a \u0432\u0441\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u0440\u0430\u0441\u043e\u0442\u0430!<br \/> \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u0434\u0430\u043b\u0435\u0435 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438. \u0414\u043b\u044f &#171;\u043b\u0438\u0433\u0438 \u043b\u0435\u043d\u0438&#187; \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0430 \u043a \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h4>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441\u043e &#171;\u0441\u043f\u0430\u0433\u0435\u0442\u0442\u0438&#187; \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e.<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434:<\/p>\n<pre><code>import cv2,time,os from ultralytics import YOLO model_yolov8 = YOLO('best3d.pt', task='detect')  #ffmpeg -i 3d_print_fail.mp4 -c:v libx264 -preset ultrafast -crf 22 output.mp4 counter=0  def yolov8_work(img,conf):                 results = model_yolov8.predict(img, conf=conf, imgsz=640,verbose=False)        boxes = results[0].boxes.xyxy.tolist()         if boxes:                 boxes = results[0].boxes.xyxy.tolist()          for i, box in enumerate(boxes):             x1, y1, x2, y2 = box                         crop = img[int(y1):int(y2), int(x1):int(x2)]                         crop = cv2.cvtColor(crop, cv2.COLOR_BGR2RGB)             cv2.imwrite(f'out\/{counter}.jpg', crop)         counter+=1  url = cv2.VideoCapture('output.mp4') #url = cv2.VideoCapture('http:\/\/192.168.1.114:8080\/?action=stream')  conf=0.3 process_this_frame = True  while True:         ret, frame=url.read()         if process_this_frame:         st=time.time()                 yolov8_work(frame,conf)         print(time.time()-st)     process_this_frame = not process_this_frame <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 timelapse \u0441\u0435\u0430\u043d\u0441\u0430 3d \u043f\u0435\u0447\u0430\u0442\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0441\u0431\u043e\u0439. \u041f\u0440\u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438 &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043d\u0438\u043c\u043e\u043a \u043d\u0430 \u0434\u0438\u0441\u043a. \u041b\u0438\u0431\u043e \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0438\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<br \/> \u0417\u0430\u043f\u0438\u0441\u0438 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u043e\u0442 creality \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<br \/> <code>ffmpeg -i 3d_print_fail.mp4 -c:v libx264 -preset ultrafast -crf 22 output.mp4<\/code><\/p>\n<h4>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 email.<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442\u044c \u043e\u0431 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c email. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 email yandex:<\/p>\n<pre><code>import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime  now = datetime.now()  # Connect to the SMTP server smtp_server = 'smtp.yandex.ru' port = 587 server = smtplib.SMTP(smtp_server, port) server.starttls()  # Login to the server server.login('___@yandex.ru', 'password')  with open ('alarm.txt') as f:     alarm_text=f.readline().strip()  date_time = now.strftime(\"%d\/%m\/%Y, %H:%M:%S\") # Create the email message sender_email = '______@yandex.ru' receiver_email = '_____@yandex.ru' message = MIMEMultipart() message['From'] = sender_email message['To'] = receiver_email message['Subject'] = f'{alarm_text}' body = f'{date_time}' message.attach(MIMEText(body, 'plain'))  # Send the email server.sendmail(sender_email, receiver_email, message.as_string())  # Close the connection to the SMTP server server.quit() <\/code><\/pre>\n<p>\u041d\u0430 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u0435\u043a\u0441\u0442 c\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438, \u0441 \u0442\u0435\u043c\u043e\u0439 \u043f\u0438\u0441\u044c\u043c\u0430 &#8212; alarm_text. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c yandex \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 <code>server.login('___@yandex.ru', 'password')<\/code>. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c &#8212; yandex.ru\/support\/id\/ru\/authorization\/app-passwords.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>import cv2,time,os from ultralytics import YOLO model_yolov8 = YOLO('best3d.pt', task='detect')  import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime  now = datetime.now()  def send_alarm():     # Connect to the SMTP server     smtp_server = 'smtp.yandex.ru'     port = 587     server = smtplib.SMTP(smtp_server, port)     server.starttls()      # Login to the server     server.login('___@yandex.ru', 'password')      with open ('alarm.txt') as f:         alarm_text=f.readline().strip()      date_time = now.strftime(\"%d\/%m\/%Y, %H:%M:%S\")     # Create the email message     sender_email = '______@yandex.ru'     receiver_email = '_____@yandex.ru'     message = MIMEMultipart()     message['From'] = sender_email     message['To'] = receiver_email     message['Subject'] = f'{alarm_text}'     body = f'{date_time}'     message.attach(MIMEText(body, 'plain'))      # Send the email     server.sendmail(sender_email, receiver_email, message.as_string())      # Close the connection to the SMTP server     server.quit()  counter=0 def yolov8_work(img,conf):      global counter                results = model_yolov8.predict(img, conf=conf, imgsz=640,verbose=False)        boxes = results[0].boxes.xyxy.tolist()         if boxes:                 boxes = results[0].boxes.xyxy.tolist()          for i, box in enumerate(boxes):             x1, y1, x2, y2 = box                         crop = img[int(y1):int(y2), int(x1):int(x2)]                         crop = cv2.cvtColor(crop, cv2.COLOR_BGR2RGB)             cv2.imwrite(f'out\/{counter}.jpg', crop)             send_alarm()         counter+=1  url = cv2.VideoCapture('output.mp4')  conf=0.3 process_this_frame = True  while True:         ret, frame=url.read()         if process_this_frame:         st=time.time()                 yolov8_work(frame,conf)         print(time.time()-st)     process_this_frame = not process_this_frame <\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u043a\u043e\u0434\u0435 &#8212; \u043f\u0440\u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438 \u043e\u043d \u043d\u0430\u0447\u043d\u0435\u0442 &#171;\u0431\u043e\u043c\u0431\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u0438\u0441\u044c\u043c\u0430\u043c\u0438&#187; \u0438 \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0438\u043b\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u043e\u0435.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0423\u0434\u0430\u0447\u043d\u043e\u0439 \u043f\u0435\u0447\u0430\u0442\u0438!<\/p>\n<p>\u0410\u0440\u0445\u0438\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u0435\u0442\u044c, \u0432\u0438\u0434\u0435\u043e &#8212; <a href=\"https:\/\/drive.google.com\/file\/d\/1oLd5YAOrN12Bq5JHaqXs__eAuCsP54L-\/view?usp=sharing\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/931622\/\"> https:\/\/habr.com\/ru\/articles\/931622\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435, &#8212; creality K1C \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d \u043a\u0430\u043c\u0435\u0440\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043f\u0435\u0447\u0430\u0442\u0438. \u0423\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435. \u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0447\u0430\u0441\u0430\u043c\u0438 \u043a\u0430\u043a \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0434\u043e\u0435\u0434\u0430\u0435\u0442. \u0412\u0434\u0432\u043e\u0439\u043d\u0435 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0435\u0447\u0430\u0442\u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b \u043f\u043e \u0442\u0435\u043c \u0438\u043b\u0438 \u0438\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0438 \u043f\u0435\u0447\u0430\u0442\u044c \u043d\u0435 \u0431\u044b\u043b\u0430 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430.  \u041a\u0430\u043a \u0440\u0430\u0437 \u043e \u0440\u0430\u043d\u043d\u0435\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0435\u0447\u0430\u0442\u0438 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0431\u0440\u0430\u043a\u0430 \u043d\u0430 \u0441\u0442\u043e\u043b\u0435 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c.<\/p>\n<p>Creality \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0432 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0440\u0430\u043d\u043d\u0435\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0435\u0447\u0430\u0442\u0438,  \u0438 \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u0433\u043b\u0430\u0437\u0430 \u0434\u0430\u0436\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438: \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432 \u043f\u0435\u0447\u0430\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u043e\u0440\u0432\u0430\u043b\u0430\u0441\u044c \u043e\u0442 \u0441\u0442\u043e\u043b\u0430, \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u0430\u043f\u043b\u044b\u0432 (blob) \u0438\u043b\u0438 \u0436\u0435 \u043f\u0440\u0438\u043d\u0442\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u043b \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c &#171;\u043c\u0430\u043a\u0430\u0440\u043e\u043d\u044b&#187; \u043d\u0438 \u0441 \u0442\u043e\u0433\u043e, \u043d\u0438 \u0441 \u0441\u0435\u0433\u043e. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0430, \u043a\u0430\u043c\u0435\u0440\u0430 \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a \u0432 \u0441\u0435\u0442\u044c.<\/p>\n<p>\u041a\u0430\u043a \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 \u043f\u0440\u0438\u043d\u0442\u0435\u0440 \u043a\u0430\u043c\u0435\u0440\u0430, &#171;\u043e\u0442\u0434\u0430\u0435\u0442&#187; \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a \u043f\u043e http (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#8212; <a href=\"http:\/\/192.168.1.114:8080\/?action=stream\" rel=\"noopener noreferrer nofollow\">http:\/\/192.168.1.114:8080\/?action=stream<\/a>) \u0438 \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0443\u043b\u0435\u0442\u0430\u044e\u0449\u0438\u0435 \u0432 \u0440\u043e\u0434\u043d\u043e\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 creality. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438\u0434\u0443\u0442 \u0442\u0443\u0434\u0430.<\/p>\n<p>\u0412\u0441\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e &#8212; &#171;\u0447\u0438\u0442\u0430\u0442\u044c&#187; \u043a\u0430\u0434\u0440\u044b \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0438, \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c email \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435. \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0447\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u0442\u043e\u0438\u0442 &#8212; \u0431\u044b\u0432\u0430\u0435\u0442 \u0438 \u043d\u0430 &#171;\u0441\u0442\u0430\u0440\u0443\u0445\u0443 \u043f\u0440\u043e\u0440\u0443\u0445\u0430&#187; &#8212; \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430.<\/p>\n<h4>\u041a\u0430\u043a \u0436\u0435 \u0431\u0435\u0437 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438.<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c. yolov8 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0432\u0435\u0436\u0435\u0435 \u0432\u0437\u044f\u0442\u044c \u0438\u0437 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 yolo.<br \/> \u0414\u0430\u0442\u0430\u0441\u0435\u0442 (\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d \u043a \u0441\u0442\u0430\u0442\u044c\u0435), \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0432\u0437\u044f\u0442 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u043d\u0430 roboflow. \u0412 \u043d\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0441 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044f\u043c\u0438: <\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 &#171;\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435&#187; \u0434\u043b\u044f yolo-detect \u043c\u043e\u0434\u0435\u043b\u0435\u0439:<br \/> <code>yolo task=detect mode=train model=yolov8s.pt imgsz=640 data=spagetti\\data.yaml epochs=10 batch=8 name=yolov8n_custom<\/code><br \/> \u0417\u0434\u0435\u0441\u044c \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f &#171;s&#187; \u043c\u043e\u0434\u0435\u043b\u044c 8\u0439 yolo \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 10 \u044d\u043f\u043e\u0445. \u0415\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c, &#171;s&#187; \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 &#171;l&#187; \u0438\/\u0438\u043b\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043f\u043e\u0445 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041a\u0430\u043a \u0432\u0441\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u043e\u0441\u044c \u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u0440\u0430\u0441\u043e\u0442\u0430!<br \/> \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u0434\u0430\u043b\u0435\u0435 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438. \u0414\u043b\u044f &#171;\u043b\u0438\u0433\u0438 \u043b\u0435\u043d\u0438&#187; \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0430 \u043a \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h4>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441\u043e &#171;\u0441\u043f\u0430\u0433\u0435\u0442\u0442\u0438&#187; \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e.<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434:<\/p>\n<pre><code>import cv2,time,os from ultralytics import YOLO model_yolov8 = YOLO('best3d.pt', task='detect')  #ffmpeg -i 3d_print_fail.mp4 -c:v libx264 -preset ultrafast -crf 22 output.mp4 counter=0  def yolov8_work(img,conf):                 results = model_yolov8.predict(img, conf=conf, imgsz=640,verbose=False)        boxes = results[0].boxes.xyxy.tolist()         if boxes:                 boxes = results[0].boxes.xyxy.tolist()          for i, box in enumerate(boxes):             x1, y1, x2, y2 = box                         crop = img[int(y1):int(y2), int(x1):int(x2)]                         crop = cv2.cvtColor(crop, cv2.COLOR_BGR2RGB)             cv2.imwrite(f'out\/{counter}.jpg', crop)         counter+=1  url = cv2.VideoCapture('output.mp4') #url = cv2.VideoCapture('http:\/\/192.168.1.114:8080\/?action=stream')  conf=0.3 process_this_frame = True  while True:         ret, frame=url.read()         if process_this_frame:         st=time.time()                 yolov8_work(frame,conf)         print(time.time()-st)     process_this_frame = not process_this_frame <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 timelapse \u0441\u0435\u0430\u043d\u0441\u0430 3d \u043f\u0435\u0447\u0430\u0442\u0438, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0441\u0431\u043e\u0439. \u041f\u0440\u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438 &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043d\u0438\u043c\u043e\u043a \u043d\u0430 \u0434\u0438\u0441\u043a. \u041b\u0438\u0431\u043e \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0438\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<br \/> \u0417\u0430\u043f\u0438\u0441\u0438 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u043e\u0442 creality \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<br \/> <code>ffmpeg -i 3d_print_fail.mp4 -c:v libx264 -preset ultrafast -crf 22 output.mp4<\/code><\/p>\n<h4>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 email.<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442\u044c \u043e\u0431 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c email. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430 email yandex:<\/p>\n<pre><code>import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime  now = datetime.now()  # Connect to the SMTP server smtp_server = 'smtp.yandex.ru' port = 587 server = smtplib.SMTP(smtp_server, port) server.starttls()  # Login to the server server.login('___@yandex.ru', 'password')  with open ('alarm.txt') as f:     alarm_text=f.readline().strip()  date_time = now.strftime(\"%d\/%m\/%Y, %H:%M:%S\") # Create the email message sender_email = '______@yandex.ru' receiver_email = '_____@yandex.ru' message = MIMEMultipart() message['From'] = sender_email message['To'] = receiver_email message['Subject'] = f'{alarm_text}' body = f'{date_time}' message.attach(MIMEText(body, 'plain'))  # Send the email server.sendmail(sender_email, receiver_email, message.as_string())  # Close the connection to the SMTP server server.quit() <\/code><\/pre>\n<p>\u041d\u0430 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u0435\u043a\u0441\u0442 c\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438, \u0441 \u0442\u0435\u043c\u043e\u0439 \u043f\u0438\u0441\u044c\u043c\u0430 &#8212; alarm_text. \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c yandex \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 <code>server.login('___@yandex.ru', 'password')<\/code>. \u041a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c &#8212; yandex.ru\/support\/id\/ru\/authorization\/app-passwords.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0449\u0438\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>import cv2,time,os from ultralytics import YOLO model_yolov8 = YOLO('best3d.pt', task='detect')  import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime  now = datetime.now()  def send_alarm():     # Connect to the SMTP server     smtp_server = 'smtp.yandex.ru'     port = 587     server = smtplib.SMTP(smtp_server, port)     server.starttls()      # Login to the server     server.login('___@yandex.ru', 'password')      with open ('alarm.txt') as f:         alarm_text=f.readline().strip()      date_time = now.strftime(\"%d\/%m\/%Y, %H:%M:%S\")     # Create the email message     sender_email = '______@yandex.ru'     receiver_email = '_____@yandex.ru'     message = MIMEMultipart()     message['From'] = sender_email     message['To'] = receiver_email     message['Subject'] = f'{alarm_text}'     body = f'{date_time}'     message.attach(MIMEText(body, 'plain'))      # Send the email     server.sendmail(sender_email, receiver_email, message.as_string())      # Close the connection to the SMTP server     server.quit()  counter=0 def yolov8_work(img,conf):      global counter                results = model_yolov8.predict(img, conf=conf, imgsz=640,verbose=False)        boxes = results[0].boxes.xyxy.tolist()         if boxes:                 boxes = results[0].boxes.xyxy.tolist()          for i, box in enumerate(boxes):             x1, y1, x2, y2 = box                         crop = img[int(y1):int(y2), int(x1):int(x2)]                         crop = cv2.cvtColor(crop, cv2.COLOR_BGR2RGB)             cv2.imwrite(f'out\/{counter}.jpg', crop)             send_alarm()         counter+=1  url = cv2.VideoCapture('output.mp4')  conf=0.3 process_this_frame = True  while True:         ret, frame=url.read()         if process_this_frame:         st=time.time()                 yolov8_work(frame,conf)         print(time.time()-st)     process_this_frame = not process_this_frame <\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u043a\u043e\u0434\u0435 &#8212; \u043f\u0440\u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0438 \u043e\u043d \u043d\u0430\u0447\u043d\u0435\u0442 &#171;\u0431\u043e\u043c\u0431\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u0438\u0441\u044c\u043c\u0430\u043c\u0438&#187; \u0438 \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0438\u043b\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u043e\u0435.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0423\u0434\u0430\u0447\u043d\u043e\u0439 \u043f\u0435\u0447\u0430\u0442\u0438!<\/p>\n<p>\u0410\u0440\u0445\u0438\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0441\u0435\u0442\u044c, \u0432\u0438\u0434\u0435\u043e &#8212; <a href=\"https:\/\/drive.google.com\/file\/d\/1oLd5YAOrN12Bq5JHaqXs__eAuCsP54L-\/view?usp=sharing\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/931622\/\"> https:\/\/habr.com\/ru\/articles\/931622\/<\/a><br \/><\/br><\/br><\/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-473134","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473134","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=473134"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473134\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}