{"id":307729,"date":"2020-07-30T15:00:17","date_gmt":"2020-07-30T15:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307729"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307729","title":{"rendered":"\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 iOS \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Core ML, Swift \u0438 Neural Engine"},"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\/company\/otus\/blog\/513186\/\"><b><i>\u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/0rm8\/\">\u00ab\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a iOS\u00bb<\/a>, \u043c\u044b \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/i><\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yo\/cv\/xu\/yocvxuybmmqdhqybustxb38ni7a.png\"><\/p>\n<hr>\n<p>  <\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  Core ML \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u0432 \u0441\u0432\u0435\u0442 Apple \u043d\u0430 WWDC 2017.<\/p>\n<p>  \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 iOS \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u043e\u0432\u044b\u0445 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Neural Engine.<a name=\"habracut\"><\/a><\/p>\n<h3>\u041e\u0431\u0437\u043e\u0440 \u0447\u0438\u043f\u0430 A11 Bionic<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kv\/32\/3h\/kv323hssb6txobf8dwdmhimqpbu.png\"><br \/>  <i>\u041d\u0430\u0447\u0438\u043d\u043a\u0430 \u0447\u0438\u043f\u0430 A11 Bionic<\/i>  <\/p>\n<blockquote><p><i>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u043e\u0432: 4.3 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430<br \/>  \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044f\u0434\u0435\u0440: 6 \u044f\u0434\u0435\u0440 ARM (64 \u0431\u0438\u0442\u0430) \u2013 2 \u0432\u044b\u0441\u043e\u043a\u043e\u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0445 (2.4 \u0413\u0413\u0446) \u2014 4 \u0441 \u043d\u0438\u0437\u043a\u0438\u043c \u044d\u043d\u0435\u0440\u0433\u043e\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435\u043c<br \/>  \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432: 3<br \/>  Neural Engine \u2013 600 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443<\/i><\/p><\/blockquote>\n<p>  12 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f 2017 Apple \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u043c\u0438\u0440\u0443 \u0447\u0438\u043f A11 Bionic \u0441 Neural Engine. \u042d\u0442\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u043e 600 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (BOPS) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f FaceID, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Animoji\">Animoji<\/a> \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Neural Engine \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Core ML API.<\/p>\n<p>  Core ML \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 Neural Engine, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u044d\u043d\u0435\u0440\u0433\u043e\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435.<\/p>\n<blockquote><p><i>\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043e\u0442\u043a\u043b\u0438\u043a \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/i><\/p><\/blockquote>\n<p>  Core ML \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. Core ML \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 Vision \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, Natural Language \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430, Speech \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0432\u0443\u043a\u0430 \u0432 \u0442\u0435\u043a\u0441\u0442 \u0438 Sound Analysis \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0432\u0443\u043a\u043e\u0432 \u0432 \u0430\u0443\u0434\u0438\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zw\/-2\/ey\/zw-2eyfuesmafbucm_n6zsvtkgw.png\"><br \/>  <i>Core ML API<\/i><br \/>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Playground, \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u043d\u0430\u0448 iOS \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<blockquote><p><b>\u0421\u043e\u0432\u0435\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432<\/b>: \u0412\u044b\u0434\u0435\u043b\u044f\u0439\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mg\/xe\/rl\/mgxerlqgxcc9iohk_uqtindq960.png\"><br \/>  <i>\u041e\u0431\u0449\u0430\u044f \u0431\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0430 Core ML<\/i><\/p>\n<h3>\u041b\u0430\u0434\u043d\u043e. \u0427\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c?<\/h3>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0432\u0430\u043c, \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Core ML, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u043e\u0432 (Orange) \u0438 \u043a\u043b\u0443\u0431\u043d\u0438\u043a\u0438 (Strawberry), \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043d\u0430\u0448\u0435 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ql\/br\/fq\/qlbrfqldo2xvvhbomvqwha7vluo.png\"><br \/>  <i>\u041c\u043e\u0434\u0435\u043b\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/i><\/p>\n<blockquote><p><b>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432<\/b>: \u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0437\u0430\u0434\u0430\u0447\u0430\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u0443\u0447\u0438\u0442\u0435\u043b\u0435\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0435\u0442\u043a\u0430 (label) \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f).<\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q5\/zy\/dx\/q5zydxv-v1zil1k-rocnj3wdztq.jpeg\"><\/p>\n<h4>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c:<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u0417\u043d\u0430\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 Swift <\/li>\n<li>\u041e\u0441\u043d\u043e\u0432\u044b iOS \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 <\/li>\n<li>\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/li>\n<\/ul>\n<p>  <b>\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/b><\/p>\n<ul>\n<li>X-code 10 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f<\/li>\n<li>iOS SDK 11.0+ <\/li>\n<li>macOS 10.13+<\/li>\n<\/ul>\n<h3>\u0421\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eh\/g4\/ov\/ehg4ovdgdfj_wscemlahcgtytr4.jpeg\"><\/p>\n<p>  \u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c Apple.<\/p>\n<ul>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043c\u0438\u043d\u0438\u043c\u0443\u043c 10 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u2014 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/li>\n<li>\u0418\u0437\u0431\u0435\u0433\u0430\u0439\u0442\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0440\u0430\u0432\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e.<\/li>\n<li>\u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0432\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0439, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Create ML UI\u2019s Augmentation: Crop, Rotate, Blur, Expose, Noise \u0438 Flip.<\/li>\n<li>\u041d\u0435 \u0431\u0440\u0435\u0437\u0433\u0443\u0439\u0442\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u043d\u0430\u0431\u043e\u0440\u043e\u0432: \u0441\u043d\u0438\u043c\u0430\u0439\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438, \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c \u0438 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f. \u0418\u043c\u0438\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0441\u044a\u0435\u043c\u043a\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0448\u0443\u043c \u0438 \u0440\u0430\u0437\u043c\u044b\u0442\u043e\u0441\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0421\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0432\u0430\u0448\u0438\u0445 \u0440\u0443\u043a\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0441\u0432\u043e\u0438\u0445 \u0440\u0443\u043a\u0430\u0445.<\/li>\n<li>\u0418\u0441\u043a\u043b\u044e\u0447\u0430\u0439\u0442\u0435 \u0438\u0437 \u043f\u043e\u043b\u044f \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443.<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0432\u0430\u0448 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 (Data Set), \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0439 (Train) \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u0447\u043d\u044b\u0439 (Test) \u043d\u0430\u0431\u043e\u0440\u044b \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ft\/co\/bn\/ftcobncfomyhzole18x0jyqq6jc.png\"><\/p>\n<blockquote><p><b>\u0412\u0410\u0416\u041d\u041e\u0415 \u041f\u0420\u0418\u041c\u0415\u0427\u0410\u041d\u0418\u0415 :<\/b> \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0447\u0442\u043e \u0432\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043f\u0430\u043f\u043a\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043f\u043a\u0438 test. <b>\u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438 \u0441\u043b\u0443\u0436\u0438\u0442 \u043c\u0435\u0442\u043a\u043e\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/b><\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rr\/lb\/2l\/rrlb2lslsh4te82xycmabysa4eq.png\"><br \/>  <i>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043f\u0430\u043f\u043a\u0438, \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u0435\u0436\u0430\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/i><\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 <\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/q0\/ja\/qd\/q0jaqdxgbyhovzjubbtcn8_1i2g.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dw\/6o\/jx\/dw6ojxpntfruarl5tiuolrkayqs.gif\"><br \/>  \u041d\u0435 \u043f\u0430\u043d\u0438\u043a\u0443\u0439\u0442\u0435! Apple \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0430 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u044d\u0442\u0430\u043f\u044b.<\/p>\n<p>  \u0421 Core ML \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044d\u0442\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0438 \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c\u0438, \u0441 Core ML \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Vision.<\/p>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u044d\u0442\u0438\u043c \u0448\u0430\u0433\u0430\u043c.<\/p>\n<p>  <b>\u0428\u0410\u0413 1<\/b>: \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u0430\u0448 X-code. <br \/>  <b>\u0428\u0410\u0413 2<\/b>: \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0447\u0438\u0441\u0442\u0443\u044e Swift Playground.<br \/>  <b>\u0428\u0410\u0413 3<\/b>: \u0423\u0434\u0430\u043b\u0438\u0442\u0435 \u043a\u043e\u0434 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <code>playground<\/code>.<\/p>\n<pre><code class=\"swift\">   import CreateMLUI \/\/\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c       let builder = MLImageClassifierBuilder()  \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0441\u0442\u0430\u043d\u0441 MLImageClassifierBuilder      builder.showInLiveView()  \/\/\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 Xcode Model builder<\/code><\/pre>\n<p>  <b>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/b><br \/>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u0438\u043b\u0434\u0435\u0440\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e XCode.<\/p>\n<p>  <b>\u0428\u0410\u0413 4<\/b>: \u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/k1\/l2\/js\/k1l2js1oxfpuxttmehn4giia8de.jpeg\"><br \/>  <i>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0443\u044e \u043f\u0443\u043d\u043a\u0442\u0438\u0440\u043d\u044b\u043c\u0438 \u043b\u0438\u043d\u0438\u044f\u043c\u0438.<\/i><\/p>\n<blockquote><p><b>\u0421\u043e\u0432\u0435\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 <\/b>: \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0449\u0435\u043b\u043a\u043d\u0443\u0432 \u0441\u0442\u0440\u0435\u043b\u043a\u0443 \u0432\u043d\u0438\u0437 \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p><\/blockquote>\n<p>  <b>\u0428\u0430\u0433 5<\/b>: Xcode \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u043d\u0430\u0447\u043d\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0445\u043e\u0434\u0438\u0442 10 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0432\u0430\u0448\u0435\u0433\u043e Mac \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0445\u043e\u0434\u043e\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u043e\u043a\u043d\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 Playground.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dc\/zy\/zq\/dczyzqrw7_i_9bgwojxmttma5b4.gif\"><br \/>  <i>\u0416\u0434\u0443 \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438.<\/i><\/p>\n<p>  <b>\u0428\u0410\u0413 6<\/b>: \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0432 \u043f\u0430\u043f\u043a\u0443 Test \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. Xcode \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bu\/yw\/so\/buywsoqagv91y6dqzvm2huorwfy.jpeg\"><br \/>  <i>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043d\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0442\u043e\u0447\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f .<\/i><\/p>\n<p>  <b>\u0428\u0410\u0413 7<\/b>: \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/po\/ya\/pd\/poyapdtldgyy7y1ykwpo3lb4lnc.jpeg\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/az\/dx\/d7\/azdxd7gpa0dkyhz73qatl9a2-ty.jpeg\"><\/p>\n<p>  <b>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/b><\/p>\n<p>  <b>\u0428\u0410\u0413 1<\/b>: \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u0430\u0448 X-code.<br \/>  <b>\u0428\u0410\u0413 2<\/b>: \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 Single Page iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<br \/>  <b>\u0428\u0410\u0413 3<\/b>: \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<br \/>  <b>\u0428\u0410\u0413 4<\/b>: \u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qw\/lj\/0j\/qwlj0jad77kl-uacw9aldspesbu.jpeg\"><br \/>  <i>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/i><\/p>\n<p>  \u0428\u0410\u0413 5: \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code>Main.storyboard<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 IBOutlets \u0438 IBActions \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i_\/ld\/ig\/i_ldigublfubx6fahu213fb5nc8.png\"><br \/>  <i>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 UIImageView, UIButtons \u0438 UILabels.<\/i><\/p>\n<p>  <b>\u0428\u0410\u0413 6<\/b>: \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <code>ViewController.swift<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">  extension ViewController: UINavigationControllerDelegate, UIImagePickerControllerDelegate {             func getimage() {               let imagePicker = UIImagePickerController() \/\/\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 UIImagePickerController()              imagePicker.delegate = self \/\/\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430              imagePicker.sourceType = .photoLibrary  \/\/\u0412\u044b\u0431\u0438\u0440\u0435\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430               imagePicker.allowsEditing = true  \/\/\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435              present(imagePicker, animated: true)  \/\/\u0412\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043e\u043a\u043d\u043e UIPickerView          }           func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo \u0421: [UIImagePickerController.InfoKey: Any]) {               let fimage = info[.editedImage] as!UIImage  \/\/\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u043b\u044e\u0447\u043e\u043c .editedImage \u0438\u0437 \u0441\u043b\u043e\u0432\u0430\u0440\u044f info               \/\/\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a UIImage              fruitImageView.image = fimage   \/\/\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 UIImageView              dismiss(animated: true, completion: nil)  \/\/\u0417\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043e\u043a\u043d\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0431\u0440\u0430\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435          }           func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {               dismiss(animated: true, completion: nil)   \/\/\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439          }       } <\/code><\/pre>\n<p>  <b>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/b> \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 ViewController \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c UINavigationControllerDelegate \u0438 UIImagePickerControllerDelegate, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c UIImagePickerView \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 PickImage UIButton. <b>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u0430.<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hv\/oy\/he\/hvoyheocmhhstugjl_0nj4aoree.jpeg\"><\/p>\n<h3>\u0428\u0430\u0433\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u043c\u043e\u0434\u0435\u043b\u0438 Core ML \u0432 iOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <br \/>  <\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/av\/m0\/8i\/avm08il19joavf16uthahqf9zmo.jpeg\"><\/p>\n<p>  <b>\u0428\u0410\u0413 1<\/b>: \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<pre><code class=\"swift\">import CoreML   import Vision<\/code><\/pre>\n<p>  <b>\u0428\u0410\u0413 2<\/b>: \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 Core ML \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"swift\">let modelobj = ImageClassifier()<\/code><\/pre>\n<p>  <b>\u0428\u0410\u0413 3<\/b>: \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c Core ML \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0438\u043f\u0430 VNCoreMLRequest (VN \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 Vision)<\/p>\n<pre><code class=\"swift\">var myrequest: VNCoreMLRequest?  \/\/\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 VNCoreMLRequest   myrequest = VNCoreMLRequest(model: fruitmodel, completionHandler: { (request, error) in     \/\/\u0418\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u0438                  \/\/\u042d\u0442\u043e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d Core ML                  self.handleResult(request: request, error: error) \/\/\u0412\u044b\u0437\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438                                                        })<\/code><\/pre>\n<p>  \u0428\u0410\u0413 4: \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043e\u0431\u0440\u0435\u0437\u0430\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e Core ML.<\/p>\n<p>  <code>myrequest!.imageCropAndScaleOption = .centerCrop<br \/>  <\/code> <br \/>  \u0428\u0410\u0413 5: \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<pre><code class=\"swift\"> func mlrequest() - &gt; VNCoreMLRequest {          var myrequest: VNCoreMLRequest ?              let modelobj = ImageClassifier()          do {              let fruitmodel =                  try VNCoreMLModel(                      for: modelobj.model)               myrequest = VNCoreMLRequest(model: fruitmodel, completionHandler: {                    (request, error) in self.handleResult(request: request, error: error)                        })           } catch {             print(&quot;Unable to create a request&quot;)           }           myrequest!.imageCropAndScaleOption = .centerCrop          return myrequest!      } <\/code><\/pre>\n<p>  <b>\u0428\u0410\u0413 6<\/b>: \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 UIImage \u0432 CIImage (CI:CoreImage), \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 Core ML \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 CIImage, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 UIImage \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435.<\/p>\n<pre><code class=\"swift\">guard  let ciImage = CIImage(image: image)  else {         return      } <\/code><\/pre>\n<p>  <b>\u0428\u0410\u0413 7<\/b>: \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0448 <code>VNCoreMLRequest<\/code>, \u0441\u043e\u0437\u0434\u0430\u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432 <code>ciImage<\/code>.<\/p>\n<pre><code class=\"swift\">let handler = VNImageRequestHandler(ciImage: ciImage)<\/code><\/pre>\n<p>  <b>\u0428\u0410\u0413 8<\/b>: \u0417\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <code>perform()<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>VNCoreMLRequest<\/code>.<\/p>\n<pre><code class=\"swift\">DispatchQueue.global(qos: .userInitiated).async {         let handler = VNImageRequestHandler(ciImage: ciImage)         do {             try handler.perform([self.mlrequest()])         } catch {              print(&quot;Failed to get the description&quot;)          }      } <\/code><\/pre>\n<p>  <b>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/b>: DispatchQueue \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e) \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c (\u0438\u043b\u0438 \u0444\u043e\u043d\u043e\u0432\u043e\u043c) \u043f\u043e\u0442\u043e\u043a\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <b>\u0428\u0410\u0413 10<\/b>: \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"swift\">func excecuteRequest(image: UIImage) {                guard              let ciImage = CIImage(image: image)              else {                  return              }              DispatchQueue.global(qos: .userInitiated).async {                  let handler = VNImageRequestHandler(ciImage: ciImage)                  do {                      try handler.perform([self.mlrequest()])                  } catch {                      print(&quot;Failed to get the description&quot;)                  }              } <\/code><\/pre>\n<p>  <b>\u0428\u0410\u0413 11<\/b>: \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>handleResult()<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>VNRequest<\/code> \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f <code>VNCoreMLRequest<\/code>.<\/p>\n<pre><code class=\"swift\">func handleResult(request: VNRequest, error: Error ? ) {           if let classificationresult = request.results as ? [VNClassificationObservation] {\/\/ \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443 VNClassificationObservation              DispatchQueue.main.async {                 self.fruitnamelbl.text = classificationresult.first!.identifier\/\/\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 UILabel \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u0443\u0442\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0442\u0435\u043a\u0441\u0442\u0443 prperty                 print(classificationresult.first!.identifier)             }          }          else {              print(&quot;Unable to get the results&quot;)          }      }  <\/code><\/pre>\n<blockquote><p><i><b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: <code>DispatchQueue.main.async<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 UIKit (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e UILabel) \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c UI Thread \u0438\u043b\u0438 Main Thread, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 (background thread).<\/i><\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pm\/tw\/2p\/pmtw2p2vxsnidk3jwaz9asfwa_m.jpeg\"><\/p>\n<h3>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 <code>ViewController.Swift<\/code><\/h3>\n<pre><code class=\"swift\">import UIKit      import CoreML      import Vision      class ViewController: UIViewController {          var name: String = &quot;&quot;          @IBOutlet weak          var fruitnamelbl: UILabel!@IBOutlet weak          var fruitImageView: UIImageView!override func viewDidLoad() {              super.viewDidLoad()              \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u043b\u044e\u0431\u0443\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f.           }          @IBAction func classifybtnclicked(_ sender: Any) {              excecuteRequest(image: fruitImageView.image!)          }          @IBAction func piclimage(_ sender: Any) {              getimage()          }          func mlrequest() - &gt; VNCoreMLRequest {              var myrequest: VNCoreMLRequest ?                  let modelobj = ImageClassifier()             do {                  let fruitmodel =                      try VNCoreMLModel(                          for: modelobj.model)                  myrequest = VNCoreMLRequest(model: fruitmodel, completionHandler: {                      (request, error) in self.handleResult(request: request, error: error)                  })              } catch {                  print(&quot;Unable to create a request&quot;)              }              myrequest!.imageCropAndScaleOption = .centerCrop              return myrequest!          }          func excecuteRequest(image: UIImage) {              guard              let ciImage = CIImage(image: image)              else {                  return              }              DispatchQueue.global(qos: .userInitiated).async {                  let handler = VNImageRequestHandler(ciImage: ciImage)                  do {                      try handler.perform([self.mlrequest()])                  } catch {                      print(&quot;Failed to get the description&quot;)                  }              }          }          func handleResult(request: VNRequest, error: Error ? ) {              if let classificationresult = request.results as ? [VNClassificationObservation] {                  DispatchQueue.main.async {                      self.fruitnamelbl.text = classificationresult.first!.identifier                      print(classificationresult.first!.identifier)                  }              }              else {                  print(&quot;Unable to get the results&quot;)              }          }      }      extension ViewController: UINavigationControllerDelegate, UIImagePickerControllerDelegate {          func getimage() {              let imagePicker = UIImagePickerController()              imagePicker.delegate = self              imagePicker.sourceType = .photoLibrary              imagePicker.allowsEditing = true              present(imagePicker, animated: true)          }          func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {              let fimage = info[.editedImage] as!UIImage              fruitImageView.image = fimage              dismiss(animated: true, completion: nil)          }          func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {              dismiss(animated: true, completion: nil)          }      }<\/code><\/pre>\n<h2>\u0412\u0441\u0435 \u0433\u043e\u0442\u043e\u0432\u043e!<\/h2>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gl\/wo\/ia\/glwoialfsc32lsomgufkvsh7pjk.gif\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0432\u0430\u0448 Simulator \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<blockquote><p><i><b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>: \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0447\u0442\u043e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u0432\u0430\u0448\u0435\u0433\u043e Simulator \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u043e\u0442\u043e \u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u043e\u0432 \u0438 \u043a\u043b\u0443\u0431\u043d\u0438\u043a\u0438.<\/i><\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/v4\/5m\/eh\/v45mehkr8mja6rkjm3wej5f30uo.jpeg\"><br \/>  <i>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Pick Image<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mv\/es\/tz\/mvestzyzjz68ecdxjdqms9fxzsw.jpeg\"><br \/>  <i>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xg\/8_\/zx\/xg8_zxphl4vk5mlx5etxqmgoobi.jpeg\"><br \/>  <i>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Classify<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xg\/8_\/zx\/xg8_zxphl4vk5mlx5etxqmgoobi.jpeg\"><br \/>  <i>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Classify<\/i><\/p>\n<h2>\u0423\u0440\u0430: <\/h2>\n<p>  \u0412\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0432\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 IOS \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Core ML.<\/p>\n<h2>\u0415\u0449\u0435:<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/502592\/\">\u041d\u0435\u043e\u043c\u043e\u0440\u0444\u0438\u0437\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SwiftUI. \u0427\u0430\u0441\u0442\u044c 1<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/503518\/\">\u041d\u0435\u043e\u043c\u043e\u0440\u0444\u0438\u0437\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e SwiftUI. \u0427\u0430\u0441\u0442\u044c 2: \u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c\u044e?<\/a><\/li>\n<li><a href=\"https:\/\/otus.pw\/0rm8\/\">\u0414\u0435\u043b\u0430\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Kotlin Multiplatform<\/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\/company\/otus\/blog\/513186\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/513186\/<\/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\/company\/otus\/blog\/513186\/\"><b><i>\u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/0rm8\/\">\u00ab\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a iOS\u00bb<\/a>, \u043c\u044b \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/i><\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yo\/cv\/xu\/yocvxuybmmqdhqybustxb38ni7a.png\"><\/p>\n<hr>\n<p>  <\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  Core ML \u2014 \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u0432 \u0441\u0432\u0435\u0442 Apple \u043d\u0430 WWDC 2017.<\/p>\n<p>  \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 iOS \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u043e\u0432\u044b\u0445 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Neural Engine.<\/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-307729","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307729","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=307729"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307729\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}