{"id":306102,"date":"2020-06-29T09:01:35","date_gmt":"2020-06-29T09:01:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306102"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306102","title":{"rendered":"\u042d\u0444\u0444\u0435\u043a\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TensorFlow.js + WASM + Three.js"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508662\/\">\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043a\u0430\u043a Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 iOS7 c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441\u0430? \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043e\u0431\u044c\u044f\u0441\u043d\u044e \u043a\u0430\u043a \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rj\/65\/g9\/rj65g9_jtm2rgljgmk6yu5sjf6k.jpeg\" alt=\"image\"><\/p>\n<p>  \u041d\u0430 \u0432\u0441\u0435\u0445 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430\u0445 \u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430\u0445 \u0441\u0435\u0439\u0447\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensoflow \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0433\u043b\u0430\u0437.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041d\u0430\u0432\u0435\u0440\u043d\u043e \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Tensorflow \u0434\u043b\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0434 \u044f\u0437\u044b\u043a\u043e\u043c Python \u0438 Javascript. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0432\u0435\u0440\u0442\u043a\u0438 \u0432 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445 \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u0441\u044f \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f CPU, \u043d\u043e \u0438 \u043d\u0430 CUDA \u043f\u043e\u0434 Python \u0438 WebGL\/WebGPU \u043f\u043e\u0434 Javascript. \u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435 NVidia, \u0442\u043e \u043e\u0444\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 Tensorflow \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Javascript \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u041f\u041a \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 OpenGL. \u041d\u043e \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 TF 2.0 \u0438\u043c\u0435\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0441\u0430\u043c\u043e\u0439 \u0441\u0443\u0442\u0438, \u0430 \u043d\u0435 \u044f\u0437\u044b\u043a\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044d\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u0422\u0430\u043a \u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b 1.0 -&gt; 2.0.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l8\/et\/wu\/l8etwujzpla-keqsctymiy6o9ea.png\"><\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0446\u0430: facemesh \u0438 blazeface. \u041f\u0435\u0440\u0432\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043c\u0438\u043c\u0438\u043a\u0438 \u0438 \u043c\u0430\u0441\u043e\u043a, \u0432\u0442\u043e\u0440\u0430\u044f \u0448\u0443\u0441\u0442\u0440\u0435\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0433\u043b\u0430\u0437\u0430, \u0443\u0448\u0438, \u0440\u043e\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u0437\u044f\u043b \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 blazeface. \u0417\u0430\u0447\u0435\u043c \u043b\u0438\u0448\u043d\u044f\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f? \u0412\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0435\u0449\u0435 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0437, \u043c\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>  \u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 5 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u0432: cpu, wasm, webgl, wasm-simd, webgpu. \u041f\u0435\u0440\u0432\u044b\u0439 \u0421PU \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0438 \u0435\u0433\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0431\u0440\u0430\u0442\u044c \u043d\u0438 \u0432 \u043a\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0434\u0432\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u044b \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0430\u0434\u0438\u0438 \u043f\u0440\u043e\u043f\u043e\u0441\u0430\u043b\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e\u0434 \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0443\u043b\u0435\u0432\u0430\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0432\u044b\u0431\u0438\u0440\u0430\u043b \u0438\u0437 \u0434\u0432\u0443\u0445: WebGL \u0438 WASM.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rn\/rf\/qb\/rnrfqbonen8cyz6mvyzwqsxmjsq.png\"><\/p>\n<p>  \u041f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0447\u0442\u043e \u0434\u043b\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 WASM \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0440\u043e\u0439 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0447\u0435\u043c WebGL. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 3\u0434 \u0441\u0446\u0435\u043d\u0430\u043c\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f WASM \u0431\u044d\u043a\u0435\u043d\u0434 \u043d\u0430 \u043d\u0438\u0445, \u044f \u043f\u043e\u043d\u044f\u043b \u0447\u0442\u043e WASM \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u0432, \u043d\u0435 \u0432\u044b\u0432\u043e\u0437\u044f\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0438 3\u0434 \u0441\u0446\u0435\u043d\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u043f\u0440\u043e\u0441\u0442\u0443\u044e <a href=\"https:\/\/munrocket.github.io\/parallax-effect\/examples\/threejs.html\" rel=\"nofollow\">\u0441\u0446\u0435\u043d\u0443 \u0441 75-\u044e \u0433\u043b\u043e\u0432\u0430\u043c\u0438<\/a> \u0432 .glb. \u0421\u0441\u044b\u043b\u043a\u0430 \u043a\u043b\u0438\u043a\u0430\u0431\u0435\u043b\u044c\u043d\u0430\u044f \u0438 \u0442\u0430\u043c WASM.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xp\/95\/5m\/xp955mesgnwwhjxejiqnm3djlk0.png\"><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0448\u043b\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0441\u043f\u0440\u043e\u0441\u0438\u043b \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u043c\u0435\u0440\u0435. \u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0430\u043b \u043d\u0435\u0442? \u0420\u0430\u0437\u0443\u043c\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438 \u0444\u043e\u043b\u043b\u0431\u044d\u0447\u0438\u0442\u044c \u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u044b\u0448\u044c\u044e\\\u0433\u0438\u0440\u043e\u0441\u043a\u043e\u043f\u043e\u043c. \u042f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b ESM \u0432\u0435\u0440\u0441\u0438\u044e tfjs-core \u0438 tfjs-converter, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0438\u043f\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441 \u0431\u0438\u0431\u0438\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 fetchInject, \u0433\u0434\u0435 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043a\u0440\u0438\u043f\u043e\u0432\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0417\u0430\u0431\u0430\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0445 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u043c\u0430\u0441\u0441\u0438\u0432 (Promise.All), \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043a\u044d\u0448.  <\/p>\n<pre><code class=\"javascript\">fetchInject([   'https:\/\/cdn.jsdelivr.net\/npm\/@tensorflow-models\/blazeface@0.0.5\/dist\/blazeface.min.js' ], fetchInject([   'https:\/\/cdn.jsdelivr.net\/npm\/@tensorflow\/tfjs-converter@2.0.1\/dist\/tf-converter.min.js',   'https:\/\/cdn.jsdelivr.net\/npm\/@tensorflow\/tfjs-backend-wasm@2.0.1\/dist\/tfjs-backend-wasm.wasm' ], fetchInject([   'https:\/\/cdn.jsdelivr.net\/npm\/@tensorflow\/tfjs-core@2.0.1\/dist\/tf-core.min.js' ]))).then(() =&gt; {    tf.wasm.setWasmPath('https:\/\/cdn.jsdelivr.net\/npm\/@tensorflow\/tfjs-backend-wasm@2.0.1\/dist\/tf-backend-wasm.min.js');    \/\/some other code  } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u0437\u0433\u043b\u044f\u0434\u0430, \u044f \u0431\u0435\u0440\u0443 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0433\u043b\u0430\u0437\u0430\u043c\u0438. \u0418 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0440\u0430\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0434\u043e \u0433\u043e\u043b\u043e\u0432\u044b, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043c\u0435\u0436\u0434\u0443 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e, \u0432 \u0441\u0438\u043b\u0443 \u043f\u043e\u0434\u043e\u0431\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430. \u0414\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0433\u043b\u0430\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0448\u0443\u043c\u043b\u0435\u043d\u043d\u044b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0430\u0447\u0435\u0442\u044b, \u044f \u0438\u0445 \u0441\u0433\u043b\u0430\u0434\u0438\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0439 \u0441\u0440\u0435\u0434\u043d\u0435\u0439 EMA (Exponential Moving Average)<\/p>\n<pre><code class=\"javascript\">pos = (1 - smooth) * pos + smooth * nextPos; <\/code><\/pre>\n<p>  \u0418\u043b\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u0432 \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443<\/p>\n<pre><code class=\"javascript\">pos *= 1 - smooth; pos += nextPos * smooth; <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b x, y, z, \u0432 \u043d\u0435\u043a\u043e\u0439 \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441 \u0446\u0435\u043d\u0442\u0440\u043e\u043c \u0432 \u043a\u0430\u043c\u0435\u0440\u0435. \u041f\u0440\u0438\u0447\u0435\u043c x \u0438 y \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0443\u0433\u043b\u043e\u043c \u043e\u0431\u0437\u043e\u0440\u0430 \u043a\u0430\u043c\u0435\u0440\u044b, \u0430 z \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0440\u0430\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0433\u043e\u043b\u043e\u0432\u044b \u0434\u043e \u043d\u0435\u0435. \u041d\u0430 \u043c\u0430\u043b\u044b\u0445 \u0443\u0433\u043b\u0430\u0445 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c72\/5f3\/451\/c725f34516b4c4263fe380300e8f1020.svg\" alt=\"$sin(\\alpha) \\approx \\alpha$\" data-tex=\"inline\"><\/math>, \u0442\u0430\u043a \u0447\u0442\u043e x \u0438 y \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430 \u0443\u0433\u043b\u044b.<\/p>\n<pre><code class=\"javascript\">pushUpdate({   x: (eyes[0] + eyes[2]) \/ video.width - 1,   y: 1 - (eyes[1] + eyes[3]) \/ video.width,   z: defautDist \/ dist }); <\/code><\/pre>\n<h3>\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0435\u0442\u0440\u0438\u044f<\/h3>\n<p>  \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u0434\u0430\u0442\u0430 \u0441\u0435\u0442 \u0441 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 SIGGRAPH 2020 Immersive light field video with a layered mesh representation. \u041e\u043d\u0438 \u0434\u0435\u043b\u0430\u043b\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435, \u0447\u0442\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043f\u043e\u0434 \u0438\u0434\u0435\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441\u0430. <a href=\"https:\/\/munrocket.github.io\/parallax-effect\/examples\/deepview.html\" rel=\"nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441\u043e\u043c.<\/a><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oo\/pp\/go\/ooppgoh3zon1kh9sxi_7urttdwy.gif\"><\/p>\n<p>  3\u0434 \u0441\u0446\u0435\u043d\u0430 \u0442\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u043e\u0439\u043d\u043e, \u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u043e\u0439 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u0430. \u041d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u0431\u0430\u0432\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u0435\u0439\u0432\u0430\u0439\u0441, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0435\u0442\u0440\u0438\u044e. \u041e\u043d\u0438 \u043a\u0443\u043f\u0438\u043b\u0438 47 \u0434\u0435\u0448\u0435\u0432\u044b\u0445 \u044d\u043a\u0448 \u043a\u0430\u043c\u0435\u0440 Yi 4K \u0437\u0430 10\u043a \u0440\u0443\u0431\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u0430\u044f, \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0438\u0445 \u043d\u0430 \u043f\u043e\u043b\u0443\u0441\u0444\u0435\u0440\u0443 \u0432 \u0444\u043e\u0440\u043c\u0435 \u0438\u043a\u043e\u0441\u0430\u044d\u0434\u0440\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430 \u0443\u0442\u0440\u043e\u0435\u043d\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u0448\u0442\u0430\u0442\u0438\u0432 \u0438 \u043a\u0430\u043c\u0435\u0440\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0441\u044c\u0435\u043c\u043a\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r5\/wp\/zh\/r5wpzheqxsp2vgqkhe9eeocwliu.jpeg\"><\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438:<\/h3>\n<p>  <\/p>\n<ul>\n<li>My github: <a href=\"https:\/\/github.com\/munrocket\/parallax-effect\" rel=\"nofollow\">github.com\/munrocket\/parallax-effect<\/a><\/li>\n<li>Immersive light field video: <a href=\"https:\/\/augmentedperception.github.io\/deepviewvideo\/\" rel=\"nofollow\">augmentedperception.github.io\/deepviewvideo<\/a><\/li>\n<li>WebGL community in telegram: <a href=\"https:\/\/t.me\/webgl_ru\" rel=\"nofollow\">t.me\/webgl_ru<\/a> <\/li>\n<\/ul>\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\/post\/508662\/\"> https:\/\/habr.com\/ru\/post\/508662\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508662\/\">\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043a\u0430\u043a Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 iOS7 c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0430\u043a\u0441\u0430? \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u043e\u0431\u044c\u044f\u0441\u043d\u044e \u043a\u0430\u043a \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rj\/65\/g9\/rj65g9_jtm2rgljgmk6yu5sjf6k.jpeg\" alt=\"image\"><\/p>\n<p>  \u041d\u0430 \u0432\u0441\u0435\u0445 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430\u0445 \u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430\u0445 \u0441\u0435\u0439\u0447\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tensoflow \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0433\u043e\u043b\u043e\u0432\u044b \u0438 \u0433\u043b\u0430\u0437.<\/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-306102","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306102","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=306102"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306102\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}