{"id":358637,"date":"2024-05-21T00:16:04","date_gmt":"2024-05-21T00:16:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=358637"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=358637","title":{"rendered":"<span>\u0414\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u043c\u0430\u0448\u0438\u043d \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u043a\u0435 \u0432 2023. \u0421 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0438 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u0444\u043e\u0442\u043e \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u043e \u043e\u043d\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0443\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043d\u0435 \u0441\u0430\u043c\u043e\u043c \u043c\u043e\u0449\u043d\u043e\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u0430\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 C++ \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c TensorFlow-Lite \u0438 Qt.<\/p>\n<h3>TensorFlow-Lite<\/h3>\n<p>TensorFlow-Lite \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f Google, \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: C++, Java, Swift, Objective-C, Python.<\/p>\n<p>\u0414\u043b\u044f TensorFlow-Lite \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, TensorFlow-<br \/> Hub, \u0442\u0430\u043a \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 TensorFlow-Lite \u043c\u043e\u0434\u0435\u043b\u044c. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0442\u0438\u043f\u0430:<\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/github.com\/tensorflow\/tflite-support\/tree\/master\">TensorFlow-Lite Support<\/a>. \u0422\u0430\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0430\u043c\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0437 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0430\u043c\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u0430\u043a TensorFlow-Lite \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u0432\u0430\u0436\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0412\u0435\u0441 \u0441\u0430\u043c\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u044d\u043d\u0435\u0440\u0433\u043e\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/de1\/3fd\/520\/de13fd5204d64e3c687fc6aff150294a.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/de1\/3fd\/520\/de13fd5204d64e3c687fc6aff150294a.png\"\/><\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u0443\u0447\u0438\u0442\u044c. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>Pruning \u2014 \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u0438\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f inference \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/youtu.be\/eZdOkDtYMoo?si=0-bgRRGfclycNpSV&amp;t=577\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/482050\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/post_images\/eb9\/ac3\/23b\/eb9ac323baa6e27d7d6a5550dd0fed8e.jpg\" alt=\"\u0421\u043b\u0430\u0439\u0434 \u0438\u0437 \u043b\u0435\u043a\u0446\u0438\u0438 \u0421\u0442\u0435\u043d\u0444\u043e\u0440\u0434\u0430\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/eb9\/ac3\/23b\/eb9ac323baa6e27d7d6a5550dd0fed8e.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0421\u043b\u0430\u0439\u0434 \u0438\u0437 \u043b\u0435\u043a\u0446\u0438\u0438 \u0421\u0442\u0435\u043d\u0444\u043e\u0440\u0434\u0430<\/figcaption><\/div>\n<\/figure>\n<ul>\n<li>\n<p>\u041a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0435\u0441\u043e\u0432 \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u044b \u043c\u043d\u043e\u0433\u0438\u0445 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/cfc\/63a\/221\/cfc63a2213756bfd14abdb0a5386202f.png\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/cfc\/63a\/221\/cfc63a2213756bfd14abdb0a5386202f.png\"\/><\/figure>\n<ul>\n<li>\n<p>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u0435\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 (\u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 float32), \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0432 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f. \u041d\u043e \u0438\u0437-\u0437\u0430 \u043d\u0435\u0451 \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/medium.com\/mlearning-ai\/master-the-art-of-quantization-a-practical-guide-e74d7aad24f9\"><strong>Master the Art of Quantization: A Practical Guide<\/strong> <em>Exploring and Implementing Quantization Methods with TensorFlow and PyTorch<\/em><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e <a href=\"https:\/\/habr.com\/ru\/companies\/doubletapp\/articles\/722798\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. TensorFlow \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 <a href=\"https:\/\/www.tensorflow.org\/model_optimization\">toolkit<\/a> \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0432 \u043d\u0435\u0433\u043e \u0443\u0436\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u044d\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435 \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Qt \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Qt Quick \u0438 TenosrFlow-Lite.<\/p>\n<p>\u041f\u0440\u043e \u0441\u0431\u043e\u0440\u043a\u0443 TensorFlow-Lite \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/719888\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u0438 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041d\u043e \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c qmake \u0438 opencv, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0412\u043c\u0435\u0441\u0442\u043e qmake \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cmake, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e opencv \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 Qt. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c gpu \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code class=\"bash\">    bazelisk build -c opt --config android_arm64 tensorflow\/lite\/delegates\/gpu:libtensorflowlite_gpu_delegate.so <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 TensorFlow, \u043a\u0430\u043a git submodule, \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  <code>include_directories(...)<\/code>.<\/p>\n<pre><code class=\"cmake\">include_directories(     headers\/     third-party\/tensorflow     third-party\/flatbuffers\/include ) <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>add_library<\/code>.<\/p>\n<pre><code class=\"cmake\">add_library(tensorflowlite SHARED IMPORTED) add_library(tensorflowlite_gpu_delegate SHARED IMPORTED) <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 <code>set_property<\/code>.<\/p>\n<pre><code class=\"cmake\"># Setup tensorflowlite property set_property(TARGET tensorflowlite PROPERTY             IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}\/lib\/tensorflow-lite\/arm64\/libtensorflowlite.so) # Setup tensorflowlite deleagte property set_property(TARGET tensorflowlite_gpu_delegate PROPERTY             IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}\/lib\/tensorflow-lite\/arm64\/libtensorflowlite_gpu_delegate.so) <\/code><\/pre>\n<p>\u0418 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>target_link_libraries<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <code>${CMAKE_BINARY_DIR}\/android-build\/libs\/arm64-v8a\/<\/code>. \u0412 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 apk.<\/p>\n<pre><code class=\"cmake\">file(GLOB libraries     \"${CMAKE_SOURCE_DIR}\/lib\/tensorflow-lite\/arm64\/*\") file(COPY ${libraries}      DESTINATION ${CMAKE_BINARY_DIR}\/android-build\/libs\/arm64-v8a) <\/code><\/pre>\n<h4>\u0412\u044b\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<p>\u041e\u0434\u043d\u043e \u0438\u0437 \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u2014 <a href=\"https:\/\/tfhub.dev\/s?deployment-format=lite\">TensorFlow Hub<\/a>. \u0422\u0430\u043c \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 <a href=\"https:\/\/tfhub.dev\/tensorflow\/efficientdet\/lite0\/detection\/1\">EfficientDet-Lite0<\/a>. \u0423 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439: \u043e\u0431\u044b\u0447\u043d\u0430\u044f, \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0430\u044f int8, \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0443\u044e, \u0442\u0430\u043a \u0438 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0443\u044e. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u044d\u0442\u0438 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">Model\\Time inference ms.<\/p>\n<\/th>\n<th>\n<p align=\"left\">avg<\/p>\n<\/th>\n<th>\n<p align=\"left\">min<\/p>\n<\/th>\n<th>\n<p align=\"left\">max<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Default<\/p>\n<\/td>\n<td>\n<p align=\"left\">103.809090909091<\/p>\n<\/td>\n<td>\n<p align=\"left\">58<\/p>\n<\/td>\n<td>\n<p align=\"left\">444<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Quant<\/p>\n<\/td>\n<td>\n<p align=\"left\">93.1909090909091<\/p>\n<\/td>\n<td>\n<p align=\"left\">55<\/p>\n<\/td>\n<td>\n<p align=\"left\">275<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0435\u0435, \u0442.\u0435 \u043d\u0435\u0442 \u0441\u043a\u0430\u0447\u043a\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438 inference. \u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043e. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 (\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 Realme 8i).<\/p>\n<h4>\u0410\u043d\u043e\u043d\u0441 \u043e\u0442 TensorFlow-Hub<\/h4>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 TensorFlow Hub \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041d\u043e \u0441 15 \u043d\u043e\u044f\u0431\u0440\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/www.kaggle.com\/models\">Kaggle Models<\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0438\u0445 <a href=\"\/https:\/\/tfhub.dev\/announcement\">\u0430\u043d\u043e\u043d\u0441\u0435<\/a>.<\/p>\n<h4>TensorFlow-Lite \u0432 \u043a\u043e\u0434\u0435<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"cpp\">    std::unique_ptr&lt;tflite::Interpreter> mInterpreter;     std::unique_ptr&lt;tflite::FlatBufferModel> mModel;     tflite::ops::builtin::BuiltinOpResolver mResolver;     TfLiteDelegate *mDelegate;     uchar *mInput; <\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0430\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<pre><code class=\"cpp\">    \/\/ Init model     mModel = tflite::FlatBufferModel::BuildFromFile(pathToModel.c_str());     \/\/ Build the interpreter     tflite::InterpreterBuilder builder(*mModel, mResolver);     \/\/ If set to the value -1, the number of threads used     \/\/ will be implementation-defined and platform-dependent.     builder.SetNumThreads(-1);     auto status = builder(&amp;mInterpreter);     qDebug() &lt;&lt; \"TensorflowModel::TensorflowModel. Builder status ok?:\"              &lt;&lt; (status == kTfLiteOk);     \/\/ Allocate tensors if previously state is ok     if (status == kTfLiteOk) {       status = mInterpreter->AllocateTensors();       qDebug() &lt;&lt; \"TensorflowModel::TensorflowModel. Tensors allocated?:\"                &lt;&lt; (status == kTfLiteOk);     }     if (status == kTfLiteOk)       mInput = mInterpreter->typed_input_tensor&lt;uchar>(0); <\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c inference \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"cpp\">    \/**      * Performs the forward pass of the TFModel using the given QImage.      * @param image The input image to be processed by the model.      * @return A std::map&lt;int, float> containing the model's output.      *\/     std::map&lt;int, double> TFModel::forward(const QImage &amp;image) noexcept {       if (mInput == nullptr) {         qWarning() &lt;&lt; \"TensorflowModel::forward(const QImage &amp;image).\"                    &lt;&lt; \"Model input equal nullptr.\";         return {};       }            const auto transformedImage = transform(image);       const auto *inputImage = transformedImage.bits();            if (inputImage == nullptr) {         qWarning() &lt;&lt; \"TensorflowModel::forward. Image equal nullptr.\";         return {};       }            std::memcpy(mInput, inputImage, constants::model::size);              if (const auto status = mInterpreter->Invoke(); status == kTfLiteOk)         return processOutput();            qWarning() &lt;&lt; \"TensorflowModel::forward. Cannot make forward;\";       return {};     } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u0442\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>transform<\/code>. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442.<\/p>\n<pre><code class=\"cpp\">    QImage TFModel::transform(const QImage &amp;image) const noexcept {       QImage inputImage{image.scaled(constants::model::inputWidth,                                      constants::model::inputHeight)};       \/\/ For these model imgFormat equal `QImage::Format_RGB888`.       \/\/ Important set the correct image format, otherwise ower predictons will       \/\/ be wrong.       inputImage.convertTo(constants::model::imgFormat);       return inputImage;     } <\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"cpp\">    \/**      * Retrieves the predictions from the model output.      * @return A map of predicted classes and their max confidence scores.      * If no predictions were made, an empty map is returned      * If on image detected few objects of the same class,      * then only the max score from it will be returned      *\/     std::map&lt;int, double> TFModel::processOutput() const noexcept {       \/\/ Model output:       \/\/ detection_boxes: Bounding box for each detection.       \/\/ detection_classes: Object class for each detection.       \/\/ detection_scores: Confidence scores for each detection.       \/\/ num_detections: Total number of detections.            \/\/ Get the total number of detected objects       const int countDetected{static_cast&lt;int>(std::floor(*getOutput&lt;float>(3)))};            \/\/ Get the detected classes and scores       const auto detectedClasses{getOutput&lt;float>(1)};       const auto detectedScores{getOutput&lt;float>(2)};            \/\/ Check if the detectedClasses and detectedScores are valid       bool itUsable{detectedClasses != nullptr};       itUsable &amp;= detectedScores != nullptr;            \/\/ Initialize the map to store the predictions       std::map&lt;int, double> predictions;            \/\/ Iterate over the detected objects       \/\/ In this model, countDetected cannot be more than 25.       for (int i = 0; itUsable &amp;&amp; (i &lt; countDetected); i++) {         const auto &amp;classId = static_cast&lt;int>(std::floor(detectedClasses[i]));         const auto &amp;score = static_cast&lt;double>(detectedScores[i]);         const bool itDetected{score >= constants::model::threshold};              \/\/ If the object is detected with a high enough confidence score         if (itDetected) {           \/\/ Add the class to the predictions map if it doesn't exist           predictions.try_emplace(classId, 0);           \/\/ Update the max score for the class if necessary           predictions[classId] = std::max(predictions[classId], score);         }       }            return predictions;     } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>getOuput<\/code>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d <code>mInterpreter->typed_output_tensor&lt;type>(numOutput)<\/code> \u0438 \u0431\u044b\u043b \u0432\u0432\u0435\u0434\u0435\u043d \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<h4>\u0421 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c<\/h4>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u2014 \u043a\u0430\u043c\u0435\u0440\u0430. \u041e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u043d\u043e \u043d\u0435 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445. \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0435\u043b\u0438\u0437\u0430\u0445 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 6.5.2.<\/p>\n<pre><code>    W ImageReader_JNI: Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers     W ImageReader_JNI: Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers     E AndroidRuntime: FATAL EXCEPTION: CameraBackground     E AndroidRuntime: Process: org.qtproject.example.camera, PID: 16762     E AndroidRuntime: java.lang.IllegalStateException: maxImages (10) has already been acquired, call #close before acquiring more.     E AndroidRuntime:     at android.media.ImageReader.acquireNextImage(ImageReader.java:501)     E AndroidRuntime:     at android.media.ImageReader.acquireLatestImage(ImageReader.java:386)     E AndroidRuntime:     at org.qtproject.qt.android.multimedia.QtCamera2$4.onImageAvailable(QtCamera2.java:157)     E AndroidRuntime:     at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:812)     E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:108)     E AndroidRuntime:     at android.os.Looper.loop(Looper.java:166)     E AndroidRuntime:     at android.os.HandlerThread.run(HandlerThread.java:65) <\/code><\/pre>\n<p>\u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0431\u0430\u0433\u0443 \u0443\u0436\u0435 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0438 qt \u0443\u0436\u0435 \u043e \u043d\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u0421\u0430\u043c \u0442\u0438\u043a\u0435\u0442 \u043d\u0430 \u0431\u0430\u0433.<br \/> <a href=\"https:\/\/bugreports.qt.io\/browse\/QTBUG-115460\">bugreports.qt.io<\/a><\/p>\n<p>\u042d\u0442\u043e\u0442 \u0431\u0430\u0433 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c qt \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e. \u041e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u2014 \u044d\u0442\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e qt. \u041c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 6.2, 6.3, 6.4, 6.5. \u0418\u0437 \u044d\u0442\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 6.4 \u043a\u0430\u043c\u0435\u0440\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0412 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0441\u0442\u044f\u043d\u0443\u0442\u043e. \u042d\u0442\u043e \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0440\u043e\u043d.<\/p>\n<h4>\u0417\u0430\u0445\u0432\u0430\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0438 \u043d\u0430 \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0417\u0430\u0445\u0432\u0430\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Qt Quick \u0438 QtMultimedia.<\/p>\n<pre><code>MediaDevices {     id: mediaDevices }  CaptureSession {     camera: Camera {         id: camera         cameraDevice: mediaDevices.defaultVideoInput         active: true         focusMode: Camera.FocusModeInfinity     }     videoOutput: preview }  VideoHandler {     id: handler     videoSink: preview.videoSink }   VideoOutput {     id: preview     property double aspectRation: 1     anchors.centerIn: parent     height: parent.height     width: aspectRation * height     fillMode: VideoOutput.Stretch     onFrameUpdated: {         aspectRation = preview.videoSink.videoSize.height \/ preview.videoSink.videoSize.width     } } <\/code><\/pre>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430. \u0412 \u043d\u0435\u043c: <code>MediaDevice<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443, <code>CaptureSession<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u0445\u0432\u0430\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, <code>VideoOutput<\/code> \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0435\u0432\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0438\u0434\u0435\u043e \u043f\u043e\u0442\u043e\u043a\u0430, \u0430 <code>VideoHandler<\/code> \u2014 \u044d\u0442\u043e \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u0432\u0438\u0434\u0435\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0451 \u0432 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c <code>mVideoSink->videoFrame().toImage()<\/code>, \u0433\u0434\u0435 <code>mVideoSink<\/code> \u2014 <code>QPointer&lt;QVideoSink><\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0432 <code>VideoHandler<\/code>.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0439. \u0420\u0430\u0431\u043e\u0442\u0443 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u0441\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c inference \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u0434\u0440\u0430, \u0430 \u0441 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0430\u0439\u043c\u0435\u0440 \u0441 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u043c \u0432 1 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 inference \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<h4>\u0414\u0435\u043b\u0435\u0433\u0430\u0442\u044b<\/h4>\n<p>\u0414\u0435\u043b\u0435\u0433\u0430\u0442\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c inference \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GPU \u0438 DSP. \u0412 TensorFlow-Lite \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0432.<\/p>\n<ul>\n<li>\n<p>GPU \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f android \u0438 ios.<\/p>\n<\/li>\n<li>\n<p>NNAPI \u0438 Hexagon \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e android.<\/p>\n<\/li>\n<li>\n<p>Core ML \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e ios.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<br \/> <a href=\"https:\/\/www.tensorflow.org\/lite\/performance\/delegates\"><strong>TensorFlow Lite Delegates<\/strong><\/a><\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 GPU \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u041d\u043e \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0412 \u0412\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043d\u0430\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u0438, \u0431\u044b\u043b\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u043d\u0430 GPU \u0438 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432 benchmark-\u0435 \u043a \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">1 CPU (ms)<\/p>\n<\/th>\n<th>\n<p align=\"left\">4 CPU (ms)<\/p>\n<\/th>\n<th>\n<p align=\"left\">GPU (ms)<\/p>\n<\/th>\n<th>\n<p align=\"left\">EdgeTPU (ms)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">49.92<\/p>\n<\/td>\n<td>\n<p align=\"left\">36.77<\/p>\n<\/td>\n<td>\n<p align=\"left\">48.48<\/p>\n<\/td>\n<td>\n<p align=\"left\">29.26<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 TensorFlow-Lite \u043d\u0430 C++ \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Qt. \u0421\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u044f inference \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u0418 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0432. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0431\u0443\u0434\u044c\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u043b\u0438\u0446\u043e\u043c \u043a \u043b\u0438\u0446\u0443  \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u043c\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438: \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0436\u0435 \u0447\u0430\u0442\u044c\u044e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u0442\u0435\u043b\u044c\u043d\u043e. \u0412\u0435\u0441\u044c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/RaftDigiAI\/Car-detection\">github<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/770302\/\"> https:\/\/habr.com\/ru\/articles\/770302\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e \u0438\u043b\u0438 \u0444\u043e\u0442\u043e \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041d\u043e \u043e\u043d\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0443\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043d\u0435 \u0441\u0430\u043c\u043e\u043c \u043c\u043e\u0449\u043d\u043e\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u0430\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 C++ \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c TensorFlow-Lite \u0438 Qt.<\/p>\n<h3>TensorFlow-Lite<\/h3>\n<p>TensorFlow-Lite \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f Google, \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: C++, Java, Swift, Objective-C, Python.<\/p>\n<p>\u0414\u043b\u044f TensorFlow-Lite \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, TensorFlow-<br \/> Hub, \u0442\u0430\u043a \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 TensorFlow-Lite \u043c\u043e\u0434\u0435\u043b\u044c. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0442\u0438\u043f\u0430:<\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041c\u043e\u0434\u0435\u043b\u044c \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/github.com\/tensorflow\/tflite-support\/tree\/master\">TensorFlow-Lite Support<\/a>. \u0422\u0430\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u0430\u043c\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0437 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0435\u0437 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0430\u043c\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u0430\u043a TensorFlow-Lite \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438<\/h3>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u0432\u0430\u0436\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0435\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0412\u0435\u0441 \u0441\u0430\u043c\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0412\u0440\u0435\u043c\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u044d\u043d\u0435\u0440\u0433\u043e\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0441\u0442\u043e\u0438\u0442 \u0438\u0437\u0443\u0447\u0438\u0442\u044c. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>Pruning \u2014 \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u0438\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f inference \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/youtu.be\/eZdOkDtYMoo?si=0-bgRRGfclycNpSV&amp;t=577\">\u0437\u0434\u0435\u0441\u044c<\/a>, \u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/articles\/482050\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\">\n<div><figcaption>\u0421\u043b\u0430\u0439\u0434 \u0438\u0437 \u043b\u0435\u043a\u0446\u0438\u0438 \u0421\u0442\u0435\u043d\u0444\u043e\u0440\u0434\u0430<\/figcaption><\/div>\n<\/figure>\n<ul>\n<li>\n<p>\u041a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0435\u0441\u043e\u0432 \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0443\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u044b \u043c\u043d\u043e\u0433\u0438\u0445 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><\/figure>\n<ul>\n<li>\n<p>\u041a\u0432\u0430\u043d\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u0435\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 (\u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 float32), \u043f\u0443\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0432 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f. \u041d\u043e \u0438\u0437-\u0437\u0430 \u043d\u0435\u0451 \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/medium.com\/mlearning-ai\/master-the-art-of-quantization-a-practical-guide-e74d7aad24f9\"><strong>Master the Art of Quantization: A Practical Guide<\/strong> <em>Exploring and Implementing Quantization Methods with TensorFlow and PyTorch<\/em><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e <a href=\"https:\/\/habr.com\/ru\/companies\/doubletapp\/articles\/722798\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. TensorFlow \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 <a href=\"https:\/\/www.tensorflow.org\/model_optimization\">toolkit<\/a> \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0432 \u043d\u0435\u0433\u043e \u0443\u0436\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u044d\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435 \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Qt \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Qt Quick \u0438 TenosrFlow-Lite.<\/p>\n<p>\u041f\u0440\u043e \u0441\u0431\u043e\u0440\u043a\u0443 TensorFlow-Lite \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/habr.com\/ru\/articles\/719888\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u0438 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u041d\u043e \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c qmake \u0438 opencv, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0412\u043c\u0435\u0441\u0442\u043e qmake \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cmake, \u0430 \u0432\u043c\u0435\u0441\u0442\u043e opencv \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 Qt. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c gpu \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code class=\"bash\">    bazelisk build -c opt --config android_arm64 tensorflow\/lite\/delegates\/gpu:libtensorflowlite_gpu_delegate.so <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 TensorFlow, \u043a\u0430\u043a git submodule, \u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  <code>include_directories(...)<\/code>.<\/p>\n<pre><code class=\"cmake\">include_directories(     headers\/     third-party\/tensorflow     third-party\/flatbuffers\/include ) <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>add_library<\/code>.<\/p>\n<pre><code class=\"cmake\">add_library(tensorflowlite SHARED IMPORTED) add_library(tensorflowlite_gpu_delegate SHARED IMPORTED) <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 <code>set_property<\/code>.<\/p>\n<pre><code class=\"cmake\"># Setup tensorflowlite property set_property(TARGET tensorflowlite PROPERTY             IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}\/lib\/tensorflow-lite\/arm64\/libtensorflowlite.so) # Setup tensorflowlite deleagte property set_property(TARGET tensorflowlite_gpu_delegate PROPERTY             IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}\/lib\/tensorflow-lite\/arm64\/libtensorflowlite_gpu_delegate.so) <\/code><\/pre>\n<p>\u0418 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>target_link_libraries<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <code>${CMAKE_BINARY_DIR}\/android-build\/libs\/arm64-v8a\/<\/code>. \u0412 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 apk.<\/p>\n<pre><code class=\"cmake\">file(GLOB libraries     \"${CMAKE_SOURCE_DIR}\/lib\/tensorflow-lite\/arm64\/*\") file(COPY ${libraries}      DESTINATION ${CMAKE_BINARY_DIR}\/android-build\/libs\/arm64-v8a) <\/code><\/pre>\n<h4>\u0412\u044b\u0431\u043e\u0440 \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<p>\u041e\u0434\u043d\u043e \u0438\u0437 \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u2014 <a href=\"https:\/\/tfhub.dev\/s?deployment-format=lite\">TensorFlow Hub<\/a>. \u0422\u0430\u043c \u0443\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u041c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 <a href=\"https:\/\/tfhub.dev\/tensorflow\/efficientdet\/lite0\/detection\/1\">EfficientDet-Lite0<\/a>. \u0423 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439: \u043e\u0431\u044b\u0447\u043d\u0430\u044f, \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0430\u044f int8, \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0443\u044e, \u0442\u0430\u043a \u0438 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0443\u044e. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u044d\u0442\u0438 \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">Model\\Time inference ms.<\/p>\n<\/th>\n<th>\n<p align=\"left\">avg<\/p>\n<\/th>\n<th>\n<p align=\"left\">min<\/p>\n<\/th>\n<th>\n<p align=\"left\">max<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Default<\/p>\n<\/td>\n<td>\n<p align=\"left\">103.809090909091<\/p>\n<\/td>\n<td>\n<p align=\"left\">58<\/p>\n<\/td>\n<td>\n<p align=\"left\">444<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Quant<\/p>\n<\/td>\n<td>\n<p align=\"left\">93.1909090909091<\/p>\n<\/td>\n<td>\n<p align=\"left\">55<\/p>\n<\/td>\n<td>\n<p align=\"left\">275<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0435\u0435, \u0442.\u0435 \u043d\u0435\u0442 \u0441\u043a\u0430\u0447\u043a\u043e\u0432 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438 inference. \u0412 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043e. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 (\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 Realme 8i).<\/p>\n<h4>\u0410\u043d\u043e\u043d\u0441 \u043e\u0442 TensorFlow-Hub<\/h4>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 TensorFlow Hub \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041d\u043e \u0441 15 \u043d\u043e\u044f\u0431\u0440\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/www.kaggle.com\/models\">Kaggle Models<\/a>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0438\u0445 <a href=\"\/https:\/\/tfhub.dev\/announcement\">\u0430\u043d\u043e\u043d\u0441\u0435<\/a>.<\/p>\n<h4>TensorFlow-Lite \u0432 \u043a\u043e\u0434\u0435<\/h4>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u044a\u044f\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"cpp\">    std::unique_ptr&lt;tflite::Interpreter> mInterpreter;     std::unique_ptr&lt;tflite::FlatBufferModel> mModel;     tflite::ops::builtin::BuiltinOpResolver mResolver;     TfLiteDelegate *mDelegate;     uchar *mInput; <\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0430\u043c\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<pre><code class=\"cpp\">    \/\/ Init model     mModel = tflite::FlatBufferModel::BuildFromFile(pathToModel.c_str());     \/\/ Build the interpreter     tflite::InterpreterBuilder builder(*mModel, mResolver);     \/\/ If set to the value -1, the number of threads used     \/\/ will be implementation-defined and platform-dependent.     builder.SetNumThreads(-1);     auto status = builder(&amp;mInterpreter);     qDebug() &lt;&lt; \"TensorflowModel::TensorflowModel. Builder status ok?:\"              &lt;&lt; (status == kTfLiteOk);     \/\/ Allocate tensors if previously state is ok     if (status == kTfLiteOk) {       status = mInterpreter->AllocateTensors();       qDebug() &lt;&lt; \"TensorflowModel::TensorflowModel. Tensors allocated?:\"                &lt;&lt; (status == kTfLiteOk);     }     if (status == kTfLiteOk)       mInput = mInterpreter->typed_input_tensor&lt;uchar>(0); <\/code><\/pre>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c inference \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"cpp\">    \/**      * Performs the forward pass of the TFModel using the given QImage.      * @param image The input image to be processed by the model.      * @return A std::map&lt;int, float> containing the model's output.      *\/     std::map&lt;int, double> TFModel::forward(const QImage &amp;image) noexcept {       if (mInput == nullptr) {         qWarning() &lt;&lt; \"TensorflowModel::forward(const QImage &amp;image).\"                    &lt;&lt; \"Model input equal nullptr.\";         return {};       }            const auto transformedImage = transform(image);       const auto *inputImage = transformedImage.bits();            if (inputImage == nullptr) {         qWarning() &lt;&lt; \"TensorflowModel::forward. Image equal nullptr.\";         return {};       }            std::memcpy(mInput, inputImage, constants::model::size);              if (const auto status = mInterpreter->Invoke(); status == kTfLiteOk)         return processOutput();            qWarning() &lt;&lt; \"TensorflowModel::forward. Cannot make forward;\";       return {};     } <\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u0442\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>transform<\/code>. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442.<\/p>\n<pre><code class=\"cpp\">    QImage TFModel::transform(const QImage &amp;image) const noexcept {       QImage inputImage{image.scaled(constants::model::inputWidth,                                      constants::model::inputHeight)};       \/\/ For these model imgFormat equal `QImage::Format_RGB888`.       \/\/ Important set the correct image format, otherwise ower predictons will       \/\/ be wrong.       inputImage.convertTo(constants::model::imgFormat);       return inputImage;     } <\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"cpp\">    \/**      * Retrieves the predictions from the model output.      * @return A map of predicted classes and their max confidence scores.      * If no predictions were made, an empty map is returned      * If on image detected few objects of the same class,      * then only the max score from it will be returned      *\/     std::map&lt;int, double> TFModel::processOutput() const noexcept {       \/\/ Model output:       \/\/ detection_boxes: Bounding box for each detection.       \/\/ detection_classes: Object class for each detection.       \/\/ detection_scores: Confidence scores for each detection.       \/\/ num_detections: Total number of detections.            \/\/ Get the total number of detected objects       const int countDetected{static_cast&lt;int>(std::floor(*getOutput&lt;float>(3)))};            \/\/ Get the detected classes and scores       const auto detectedClasses{getOutput&lt;float>(1)};       const auto detectedScores{getOutput&lt;float>(2)};            \/\/ Check if the detectedClasses and detectedScores are valid       bool itUsable{detectedClasses != nullptr};       itUsable &amp;= detectedScores != nullptr;            \/\/ Initialize the map to store the predictions       std::map&lt;int, double> predictions;            \/\/ Iterate over the detected objects       \/\/ In this model, countDetected cannot <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\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-358637","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358637","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=358637"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/358637\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}