{"id":313899,"date":"2020-11-27T15:01:25","date_gmt":"2020-11-27T15:01:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=313899"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=313899","title":{"rendered":"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0438\u0446 \u0432 Node.js \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Rust \u0438 WebAssembly"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u0411\u0443\u0434\u0443\u0449\u0438\u043c \u0443\u0447\u0430\u0449\u0438\u043c\u0441\u044f \u043d\u0430 \u043a\u0443\u0440\u0441\u0435 <a href=\"https:\/\/otus.pw\/Cy3O\/\">&#171;Node.js Developer&#187;<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435 <a href=\"https:\/\/otus.pw\/2FGz\/\">&#171;\u0414\u043e\u043a\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f node.js \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&#187;<\/a>.<\/p>\n<p>\u0410 \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d46\/8fb\/531\/d468fb531bf563d1c29a371b04870b2f\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<hr>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438, <a href=\"https:\/\/dev.to\/alabulei1\/how-to-call-rust-funtion-in-node-js-p36\"><u>\u043a\u0430\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Rust \u0438\u0437 Node.js<\/u><\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 AIaaS (\u0430\u043d\u0433\u043b. Artificial Intelligence as a Service&nbsp;\u2014 \u00ab\u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442 \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0430\u00bb) \u043d\u0430 \u0431\u0430\u0437\u0435 Node.js.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u043e\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python, \u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f JavaScript. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0418\u0418 \u0432 \u0432\u0435\u0431\u0435, \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0418\u0418 \u0432 JavaScript, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 Node.js.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0438 Python, \u043d\u0438 JavaScript \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0418\u0418-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u043b\u043e\u043a\u0438 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 Python \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 C\/C++-\u043c\u043e\u0434\u0443\u043b\u0438. \u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0432 Node.js, \u043d\u043e \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0448\u0435&nbsp;\u2014 WebAssembly.<\/p>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b WebAssembly \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u0435\u0441\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Node.js \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0440\u0435\u0434\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript-\u043a\u043e\u0434\u0430. \u041e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 WebAssembly \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>AIaaS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 Node.js \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>WebAssembly<\/code> \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0418\u0418.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438, \u043f\u043e\u0441\u0442\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>WebAssembly<\/code>. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044f\u0437\u044b\u043a Rust. \u0424\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0418\u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>WebAssembly<\/code>&nbsp;\u2014 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432 Python \u0438 Node.js \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/550\/d62\/334\/550d62334d32138f0756836b4d5be9c3\" width=\"880\" height=\"324\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h3>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446<\/h3>\n<p><a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/nodejs\/face_detection_service\"><u>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446<\/u><\/a> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043b\u0438\u0446\u0430 \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0440\u0430\u043c\u043a\u043e\u0439.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Rust \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446 MTCNN \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043e\u0442 Cetra: <a href=\"https:\/\/cetra3.github.io\/blog\/face-detection-with-tensorflow-rust\/\"><u>\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0438\u0446 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Tensorflow \u043d\u0430 Rust<\/u><\/a>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b Tensorflow \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0432 WebAssembly, \u043c\u044b \u043a\u043e\u0435-\u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f9d\/c01\/460\/f9dc01460b10ee378065f29dd2c13196.gif\" width=\"640\" height=\"494\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/nodejs\/face_detection_service\/node\/server.js\"><u>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js<\/u><\/a> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<pre><code class=\"javascript\">app.post('\/infer', function (req, res) {   let image_file = req.files.image_file;   var result_filename = uuidv4() + \".png\";    \/\/ Call the infer() function from WebAssembly (SSVM)   var res = infer(req.body.detection_threshold, image_file.data);    fs.writeFileSync(\"public\/\" + result_filename, res);   res.send('&lt;img src=\"' +  result_filename + '\"\/&gt;'); });<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, JavaScript-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>infer()<\/code> \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>detection_threshold<\/code>, \u0437\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043b\u0438\u0446\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/nodejs\/face_detection_service\/src\/lib.rs\"><u>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <\/u><\/a><code>infer()<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust \u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 WebAssembly, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u0437 JavaScript.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>infer()<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u043b\u043e\u0441\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432. \u041e\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c TensorFlow \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043b\u043e\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 TensorFlow \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0447\u0438\u0441\u0435\u043b&nbsp;\u2014 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0440\u0430\u043c\u043a\u0438, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u043b\u0438\u0446\u043e. \u0417\u0430\u0442\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>infer()<\/code> \u0440\u0438\u0441\u0443\u0435\u0442 \u0440\u0430\u043c\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043b\u0438\u0446\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 PNG \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<pre><code class=\"javascript\">#[wasm_bindgen] pub fn infer(detection_threshold: &amp;str, image_data: &amp;[u8]) -&gt; Vec&lt;u8&gt; {     let mut dt = detection_threshold;     ... ...     let mut img = image::load_from_memory(image_data).unwrap();      \/\/ Run the tensorflow model using the face_detection_mtcnn native wrapper     let mut cmd = Command::new(\"face_detection_mtcnn\");     \/\/ Pass in some arguments     cmd.arg(img.width().to_string())         .arg(img.height().to_string())         .arg(dt);     \/\/ The image bytes data is passed in via STDIN     for (_x, _y, rgb) in img.pixels() {         cmd.stdin_u8(rgb[2] as u8)             .stdin_u8(rgb[1] as u8)             .stdin_u8(rgb[0] as u8);     }     let out = cmd.output();      \/\/ Draw boxes from the result JSON array     let line = Pixel::from_slice(&amp;[0, 255, 0, 0]);     let stdout_json: Value = from_str(str::from_utf8(&amp;out.stdout).expect(\"[]\")).unwrap();     let stdout_vec = stdout_json.as_array().unwrap();     for i in 0..stdout_vec.len() {         let xy = stdout_vec[i].as_array().unwrap();         let x1: i32 = xy[0].as_f64().unwrap() as i32;         let y1: i32 = xy[1].as_f64().unwrap() as i32;         let x2: i32 = xy[2].as_f64().unwrap() as i32;         let y2: i32 = xy[3].as_f64().unwrap() as i32;         let rect = Rect::at(x1, y1).of_size((x2 - x1) as u32, (y2 - y1) as u32);         draw_hollow_rect_mut(&amp;mut img, rect, *line);     }        let mut buf = Vec::new();     \/\/ Write the result image into STDOUT     img.write_to(&amp;mut buf, image::ImageOutputFormat::Png).expect(\"Unable to write\");     return buf; }<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/native_model_zoo\/face_detection_mtcnn\/src\/main.rs\"><u>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <\/u><\/a><code>face_detection_mtcnn<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c TensorFlow \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0440\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430: \u0448\u0438\u0440\u0438\u043d\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0432\u044b\u0441\u043e\u0442\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043b\u043e\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 RGB \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>infer()<\/code> WebAssembly \u0447\u0435\u0440\u0435\u0437 STDIN. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 <code>JSON<\/code> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>STDOUT<\/code>.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 detection<em>t <\/em><code>hreshold<\/code><em> \u0432 \u0442\u0435\u043d\u0437\u043e\u0440 min<\/em>size, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u043d\u0437\u043e\u0440 <code>input<\/code> \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0422\u0435\u043d\u0437\u043e\u0440 <code>box<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"javascript\">fn main() -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {     \/\/ Get the arguments passed in from WebAssembly     let args: Vec&lt;String&gt; = env::args().collect();     let img_width: u64 = args[1].parse::&lt;u64&gt;().unwrap();     let img_height: u64 = args[2].parse::&lt;u64&gt;().unwrap();     let detection_threshold: f32 = args[3].parse::&lt;f32&gt;().unwrap();     let mut buffer: Vec&lt;u8&gt; = Vec::new();     let mut flattened: Vec&lt;f32&gt; = Vec::new();      \/\/ The image bytes are read from STDIN     io::stdin().read_to_end(&amp;mut buffer)?;     for num in buffer {         flattened.push(num.into());     }      \/\/ Load up the graph as a byte array and create a tensorflow graph.     let model = include_bytes!(\"mtcnn.pb\");     let mut graph = Graph::new();     graph.import_graph_def(&amp;*model, &amp;ImportGraphDefOptions::new())?;      let mut args = SessionRunArgs::new();     \/\/ The `input` tensor expects BGR pixel data from the input image     let input = Tensor::new(&amp;[img_height, img_width, 3]).with_values(&amp;flattened)?;     args.add_feed(&amp;graph.operation_by_name_required(\"input\")?, 0, &amp;input);      \/\/ The `min_size` tensor takes the detection_threshold argument     let min_size = Tensor::new(&amp;[]).with_values(&amp;[detection_threshold])?;     args.add_feed(&amp;graph.operation_by_name_required(\"min_size\")?, 0, &amp;min_size);      \/\/ Default input params for the model     let thresholds = Tensor::new(&amp;[3]).with_values(&amp;[0.6f32, 0.7f32, 0.7f32])?;     args.add_feed(&amp;graph.operation_by_name_required(\"thresholds\")?, 0, &amp;thresholds);     let factor = Tensor::new(&amp;[]).with_values(&amp;[0.709f32])?;     args.add_feed(&amp;graph.operation_by_name_required(\"factor\")?, 0, &amp;factor);      \/\/ Request the following outputs after the session runs.     let bbox = args.request_fetch(&amp;graph.operation_by_name_required(\"box\")?, 0);      let session = Session::new(&amp;SessionOptions::new(), &amp;graph)?;     session.run(&amp;mut args)?;      \/\/ Get the bounding boxes     let bbox_res: Tensor&lt;f32&gt; = args.fetch(bbox)?;     let mut iter = 0;     let mut json_vec: Vec&lt;[f32; 4]&gt; = Vec::new();     while (iter * 4) &lt; bbox_res.len() {         json_vec.push([             bbox_res[4 * iter + 1], \/\/ x1             bbox_res[4 * iter],     \/\/ y1             bbox_res[4 * iter + 3], \/\/ x2             bbox_res[4 * iter + 2], \/\/ y2         ]);         iter += 1;     }     let json_obj = json!(json_vec);     \/\/ Return result JSON in STDOUT     println!(\"{}\", json_obj.to_string());      Ok(()) }<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c&nbsp;\u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0418\u0418, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Rust, Node.js, \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 <a href=\"https:\/\/www.secondstate.io\/ssvm\/\"><u>Second State WebAssembly VM<\/u><\/a> \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/www.secondstate.io\/articles\/ssvmup\/\"><u>ssvmup<\/u><\/a>. <a href=\"https:\/\/www.secondstate.io\/articles\/setup-rust-nodejs\/\"><u>\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439<\/u><\/a> \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c Docker-\u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 TensorFlow.<\/p>\n<pre><code class=\"javascript\">$ wget https:\/\/storage.googleapis.com\/tensorflow\/libtensorflow\/libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz $ sudo tar -C \/usr\/ -xzf libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 TensorFlow. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Rust, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/native_model_zoo\/face_detection_mtcnn\"><u>\u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a>.<\/p>\n<pre><code class=\"javascript\"># in the native_model_zoo\/face_detection_mtcnn directory $ cargo install --path .<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/nodejs\/face_detection_service\"><u>\u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/u><\/a>. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 ssvmup \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 WebAssembly \u0438\u0437 Rust.\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f WebAssembly \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\"># in the nodejs\/face_detection_service directory $ ssvmup build<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0440\u0430\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e WebAssembly, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js.<\/p>\n<pre><code class=\"javascript\">$ npm i express express-fileupload uuid  $ cd node $ node server.js<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 8080 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0435\u043b\u0444\u0438, \u0441\u0435\u043c\u0435\u0439\u043d\u044b\u0435 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438!<\/p>\n<h3>TensorFlow Model Zoo<\/h3>\n<p>\u041f\u0430\u043a\u0435\u0442 Rust <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/native_model_zoo\/face_detection_mtcnn\/src\/main.rs\">face<em>detection<\/em>mtcnn<\/a>&nbsp;\u2014 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TensorFlow. \u041e\u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c TensorFlow (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c), \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u043d\u0435\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0448\u0430 \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0440\u0430\u043c\u043e\u043a \u0432\u043e\u043a\u0440\u0443\u0433 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043b\u0438\u0446. \u041c\u043e\u0434\u0435\u043b\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0443\u0440\u043e\u0432\u043d\u0438 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043b\u0438\u0446\u0430 \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0433\u043b\u0430\u0437, \u0440\u0442\u0430 \u0438 \u043d\u043e\u0441\u0430. \u0415\u0441\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0442\u0435\u043d\u0437\u043e\u0440\u043e\u0432 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0438 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0432\u0435\u0440\u043d\u0435\u0442 \u0435\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e WASM.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e. \u0412\u0430\u043c \u043b\u0438\u0448\u044c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u043d\u0437\u043e\u0440\u0430 \u0438 \u0438\u0445 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/native_model_zoo\"><u>native model zoo<\/u><\/a>, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust \u0434\u043b\u044f \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 TensorFlow.<\/p>\n<h3>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435<\/h3>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c AIaaS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Rust \u0438 WebAssembly \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041d\u0430\u0448 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u043c \u0432\u043d\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0439 \u0432\u043a\u043b\u0430\u0434 \u0432 Model Zoo (\u00ab\u0437\u043e\u043e\u043f\u0430\u0440\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439\u00bb), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441\u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0418\u0418-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0440\u0443\u0433\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c TensorFlow \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0446\u0435\u043b\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<hr>\n<blockquote>\n<p><a href=\"https:\/\/otus.pw\/Cy3O\/\">\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435<\/a> \u043e \u043a\u0443\u0440\u0441\u0435 &#171;Node.js Developer&#187;. \u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435 &#171;\u0414\u043e\u043a\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f node.js \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&#187; \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/otus.pw\/2FGz\/\">\u0437\u0434\u0435\u0441\u044c.<\/a><\/p>\n<\/blockquote>\n<\/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\/company\/otus\/blog\/530258\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/530258\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u0411\u0443\u0434\u0443\u0449\u0438\u043c \u0443\u0447\u0430\u0449\u0438\u043c\u0441\u044f \u043d\u0430 \u043a\u0443\u0440\u0441\u0435 <a href=\"https:\/\/otus.pw\/Cy3O\/\">&#171;Node.js Developer&#187;<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0443\u0440\u043e\u043a \u043f\u043e \u0442\u0435\u043c\u0435 <a href=\"https:\/\/otus.pw\/2FGz\/\">&#171;\u0414\u043e\u043a\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f node.js \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&#187;<\/a>.<\/p>\n<p>\u0410 \u043f\u043e\u043a\u0430 \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<hr>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438, <a href=\"https:\/\/dev.to\/alabulei1\/how-to-call-rust-funtion-in-node-js-p36\"><u>\u043a\u0430\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Rust \u0438\u0437 Node.js<\/u><\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 AIaaS (\u0430\u043d\u0433\u043b. Artificial Intelligence as a Service&nbsp;\u2014 \u00ab\u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442 \u043a\u0430\u043a \u0443\u0441\u043b\u0443\u0433\u0430\u00bb) \u043d\u0430 \u0431\u0430\u0437\u0435 Node.js.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u043e\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python, \u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f JavaScript. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0418\u0418 \u0432 \u0432\u0435\u0431\u0435, \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0418\u0418 \u0432 JavaScript, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 Node.js.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0438 Python, \u043d\u0438 JavaScript \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0418\u0418-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0431\u043b\u043e\u043a\u0438 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 Python \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 C\/C++-\u043c\u043e\u0434\u0443\u043b\u0438. \u0422\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0432 Node.js, \u043d\u043e \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0448\u0435&nbsp;\u2014 WebAssembly.<\/p>\n<p>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b WebAssembly \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u0435\u0441\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 Node.js \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0440\u0435\u0434\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f JavaScript-\u043a\u043e\u0434\u0430. \u041e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u044b \u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 WebAssembly \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>AIaaS-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 Node.js \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>WebAssembly<\/code> \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0418\u0418.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438, \u043f\u043e\u0441\u0442\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>WebAssembly<\/code>. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044f\u0437\u044b\u043a Rust. \u0424\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0418\u0418 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>WebAssembly<\/code>&nbsp;\u2014 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432 Python \u0438 Node.js \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h3>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446<\/h3>\n<p><a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/nodejs\/face_detection_service\"><u>\u0412\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446<\/u><\/a> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043b\u0438\u0446\u0430 \u0437\u0435\u043b\u0435\u043d\u043e\u0439 \u0440\u0430\u043c\u043a\u043e\u0439.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Rust \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446 MTCNN \u0441\u043e\u0437\u0434\u0430\u043d \u043f\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043e\u0442 Cetra: <a href=\"https:\/\/cetra3.github.io\/blog\/face-detection-with-tensorflow-rust\/\"><u>\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043b\u0438\u0446 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Tensorflow \u043d\u0430 Rust<\/u><\/a>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b Tensorflow \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0432 WebAssembly, \u043c\u044b \u043a\u043e\u0435-\u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/nodejs\/face_detection_service\/node\/server.js\"><u>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js<\/u><\/a> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<pre><code class=\"javascript\">app.post('\/infer', function (req, res) {   let image_file = req.files.image_file;   var result_filename = uuidv4() + \".png\";    \/\/ Call the infer() function from WebAssembly (SSVM)   var res = infer(req.body.detection_threshold, image_file.data);    fs.writeFileSync(\"public\/\" + result_filename, res);   res.send('&lt;img src=\"' +  result_filename + '\"\/&gt;'); });<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, JavaScript-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>infer()<\/code> \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>detection_threshold<\/code>, \u0437\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043b\u0438\u0446\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/nodejs\/face_detection_service\/src\/lib.rs\"><u>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <\/u><\/a><code>infer()<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust \u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 WebAssembly, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u0437 JavaScript.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>infer()<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u043b\u043e\u0441\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432. \u041e\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c TensorFlow \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u043b\u043e\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 TensorFlow \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0447\u0438\u0441\u0435\u043b&nbsp;\u2014 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0440\u0430\u043c\u043a\u0438, \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0439 \u043b\u0438\u0446\u043e. \u0417\u0430\u0442\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>infer()<\/code> \u0440\u0438\u0441\u0443\u0435\u0442 \u0440\u0430\u043c\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043b\u0438\u0446\u0430 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 PNG \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<pre><code class=\"javascript\">#[wasm_bindgen] pub fn infer(detection_threshold: &amp;str, image_data: &amp;[u8]) -&gt; Vec&lt;u8&gt; {     let mut dt = detection_threshold;     ... ...     let mut img = image::load_from_memory(image_data).unwrap();      \/\/ Run the tensorflow model using the face_detection_mtcnn native wrapper     let mut cmd = Command::new(\"face_detection_mtcnn\");     \/\/ Pass in some arguments     cmd.arg(img.width().to_string())         .arg(img.height().to_string())         .arg(dt);     \/\/ The image bytes data is passed in via STDIN     for (_x, _y, rgb) in img.pixels() {         cmd.stdin_u8(rgb[2] as u8)             .stdin_u8(rgb[1] as u8)             .stdin_u8(rgb[0] as u8);     }     let out = cmd.output();      \/\/ Draw boxes from the result JSON array     let line = Pixel::from_slice(&amp;[0, 255, 0, 0]);     let stdout_json: Value = from_str(str::from_utf8(&amp;out.stdout).expect(\"[]\")).unwrap();     let stdout_vec = stdout_json.as_array().unwrap();     for i in 0..stdout_vec.len() {         let xy = stdout_vec[i].as_array().unwrap();         let x1: i32 = xy[0].as_f64().unwrap() as i32;         let y1: i32 = xy[1].as_f64().unwrap() as i32;         let x2: i32 = xy[2].as_f64().unwrap() as i32;         let y2: i32 = xy[3].as_f64().unwrap() as i32;         let rect = Rect::at(x1, y1).of_size((x2 - x1) as u32, (y2 - y1) as u32);         draw_hollow_rect_mut(&amp;mut img, rect, *line);     }        let mut buf = Vec::new();     \/\/ Write the result image into STDOUT     img.write_to(&amp;mut buf, image::ImageOutputFormat::Png).expect(\"Unable to write\");     return buf; }<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/native_model_zoo\/face_detection_mtcnn\/src\/main.rs\"><u>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <\/u><\/a><code>face_detection_mtcnn<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c TensorFlow \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u041e\u043d\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0440\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430: \u0448\u0438\u0440\u0438\u043d\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0432\u044b\u0441\u043e\u0442\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043b\u0438\u0446\u0430 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043b\u043e\u0441\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 RGB \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>infer()<\/code> WebAssembly \u0447\u0435\u0440\u0435\u0437 STDIN. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 <code>JSON<\/code> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>STDOUT<\/code>.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 detection<em>t <\/em><code>hreshold<\/code><em> \u0432 \u0442\u0435\u043d\u0437\u043e\u0440 min<\/em>size, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u0435\u043d\u0437\u043e\u0440 <code>input<\/code> \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443. \u0422\u0435\u043d\u0437\u043e\u0440 <code>box<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"javascript\">fn main() -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {     \/\/ Get the arguments passed in from WebAssembly     let args: Vec&lt;String&gt; = env::args().collect();     let img_width: u64 = args[1].parse::&lt;u64&gt;().unwrap();     let img_height: u64 = args[2].parse::&lt;u64&gt;().unwrap();     let detection_threshold: f32 = args[3].parse::&lt;f32&gt;().unwrap();     let mut buffer: Vec&lt;u8&gt; = Vec::new();     let mut flattened: Vec&lt;f32&gt; = Vec::new();      \/\/ The image bytes are read from STDIN     io::stdin().read_to_end(&amp;mut buffer)?;     for num in buffer {         flattened.push(num.into());     }      \/\/ Load up the graph as a byte array and create a tensorflow graph.     let model = include_bytes!(\"mtcnn.pb\");     let mut graph = Graph::new();     graph.import_graph_def(&amp;*model, &amp;ImportGraphDefOptions::new())?;      let mut args = SessionRunArgs::new();     \/\/ The `input` tensor expects BGR pixel data from the input image     let input = Tensor::new(&amp;[img_height, img_width, 3]).with_values(&amp;flattened)?;     args.add_feed(&amp;graph.operation_by_name_required(\"input\")?, 0, &amp;input);      \/\/ The `min_size` tensor takes the detection_threshold argument     let min_size = Tensor::new(&amp;[]).with_values(&amp;[detection_threshold])?;     args.add_feed(&amp;graph.operation_by_name_required(\"min_size\")?, 0, &amp;min_size);      \/\/ Default input params for the model     let thresholds = Tensor::new(&amp;[3]).with_values(&amp;[0.6f32, 0.7f32, 0.7f32])?;     args.add_feed(&amp;graph.operation_by_name_required(\"thresholds\")?, 0, &amp;thresholds);     let factor = Tensor::new(&amp;[]).with_values(&amp;[0.709f32])?;     args.add_feed(&amp;graph.operation_by_name_required(\"factor\")?, 0, &amp;factor);      \/\/ Request the following outputs after the session runs.     let bbox = args.request_fetch(&amp;graph.operation_by_name_required(\"box\")?, 0);      let session = Session::new(&amp;SessionOptions::new(), &amp;graph)?;     session.run(&amp;mut args)?;      \/\/ Get the bounding boxes     let bbox_res: Tensor&lt;f32&gt; = args.fetch(bbox)?;     let mut iter = 0;     let mut json_vec: Vec&lt;[f32; 4]&gt; = Vec::new();     while (iter * 4) &lt; bbox_res.len() {         json_vec.push([             bbox_res[4 * iter + 1], \/\/ x1             bbox_res[4 * iter],     \/\/ y1             bbox_res[4 * iter + 3], \/\/ x2             bbox_res[4 * iter + 2], \/\/ y2         ]);         iter += 1;     }     let json_obj = json!(json_vec);     \/\/ Return result JSON in STDOUT     println!(\"{}\", json_obj.to_string());      Ok(()) }<\/code><\/pre>\n<p>\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c&nbsp;\u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0418\u0418, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Rust, Node.js, \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 <a href=\"https:\/\/www.secondstate.io\/ssvm\/\"><u>Second State WebAssembly VM<\/u><\/a> \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/www.secondstate.io\/articles\/ssvmup\/\"><u>ssvmup<\/u><\/a>. <a href=\"https:\/\/www.secondstate.io\/articles\/setup-rust-nodejs\/\"><u>\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439<\/u><\/a> \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c Docker-\u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 TensorFlow.<\/p>\n<pre><code class=\"javascript\">$ wget https:\/\/storage.googleapis.com\/tensorflow\/libtensorflow\/libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz $ sudo tar -C \/usr\/ -xzf libtensorflow-gpu-linux-x86_64-1.15.0.tar.gz<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0446 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 TensorFlow. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 Rust, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/native_model_zoo\/face_detection_mtcnn\"><u>\u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/u><\/a>.<\/p>\n<pre><code class=\"javascript\"># in the native_model_zoo\/face_detection_mtcnn directory $ cargo install --path .<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/tree\/master\/nodejs\/face_detection_service\"><u>\u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/u><\/a>. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 ssvmup \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 WebAssembly \u0438\u0437 Rust.\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f WebAssembly \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\"># in the nodejs\/face_detection_service directory $ ssvmup build<\/code><\/pre>\n<p>\u0421\u043e\u0431\u0440\u0430\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e WebAssembly, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.js.<\/p>\n<pre><code class=\"javascript\">$ npm i express express-fileupload uuid  $ cd node $ node server.js<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 8080 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0435\u043b\u0444\u0438, \u0441\u0435\u043c\u0435\u0439\u043d\u044b\u0435 \u0438\u043b\u0438 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438!<\/p>\n<h3>TensorFlow Model Zoo<\/h3>\n<p>\u041f\u0430\u043a\u0435\u0442 Rust <a href=\"https:\/\/github.com\/second-state\/AI-as-a-Service\/blob\/master\/native_model_zoo\/face_detection_mtcnn\/src\/main.rs\">face<em>detection<\/em>mtcnn<\/a>&nbsp;\u2014 \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TensorFlow. \u041e\u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c<\/p>\n<\/hr>\n<\/blockquote>\n<\/div>\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-313899","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313899","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=313899"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313899\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}