{"id":301407,"date":"2020-04-07T09:00:28","date_gmt":"2020-04-07T09:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301407"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-04-07T09:00:28","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301407","title":{"rendered":"\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 Android \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TensorFlow Lite \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Azure Custom Vision"},"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\/microsoft\/blog\/494782\/\">\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c Xamarin \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u0445. <\/p>\n<p>  \u0412\u0441\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0435\u043f\u043e\u0437\u0438\u0442\u0430, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u0444\u043e\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 HotDog, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043d\u0430\u0448\u0430 \u0435\u0434\u0430 \u0445\u043e\u0442-\u0434\u043e\u0433\u043e\u043c.<\/p>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0443 Azure Custom Vision \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0441\u0435\u0440\u0432\u0438\u0441\u0430 Azure Custom Vision<\/a>, <a href=\"https:\/\/www.tensorflow.org\/lite\">TensorFlow Lite<\/a> (\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c) \u0438 <a href=\"https:\/\/docs.microsoft.com\/xamarin\/android?WT.mc_id=aiapril-xamblog-bramin\">Xamarin.Android<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w6\/7s\/is\/w67sispgfa1h0zaexrrmfixvnjm.jpeg\"><a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0414\u043b\u044f <a href=\"https:\/\/docs.microsoft.com\/xamarin\/ios?WT.mc_id=aiapril-xamblog-bramin\">Xamarin.iOS<\/a> \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0441\u0435\u0440\u0432\u0438\u0441 Azure Custom Vision<\/a> \u0441 <a href=\"https:\/\/docs.microsoft.com\/xamarin\/ios\/platform\/introduction-to-ios11\/coreml?WT.mc_id=aiapril-xamblog-bramin\">CoreML<\/a>, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u0438\u0431\u0435\u0440\u0435\u0436\u0435\u043c \u044d\u0442\u043e \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  <img decoding=\"async\" width=\"300\" src=\"https:\/\/habrastorage.org\/webt\/ki\/tc\/xd\/kitcxdmde-k-718arxf4blrp8dw.gif\" alt=\"image\"><\/p>\n<h2>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h2>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 Azure Custom Vision \u0438 TensorFlow Lite \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<h4>1. \u0421\u0435\u0440\u0432\u0438\u0441 Azure Custom Vision<\/h4>\n<p>  <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0421\u0435\u0440\u0432\u0438\u0441 Azure Custom Vision<\/a> \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u2014 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u043f\u044b\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Artificail Intelligence (AI) \u0438\u043b\u0438 Machine Learning (ML).<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0432\u0435\u0431-\u043f\u043e\u0440\u0442\u0430\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Custom Vision<\/a>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0431\u0435\u0437 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u043e\u0434\u0430 AI\/ML:<\/p>\n<ol>\n<li>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0435\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <\/li>\n<li>\u041e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0422\u0435\u0433\u0438\/\u041c\u0435\u0442\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430(\u043e\u0432) \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 <\/li>\n<li>\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c (\u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445) <\/li>\n<li>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 Custom Vision \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0441\u044f \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c! <\/li>\n<\/ol>\n<p>  <\/p>\n<h4>2. TensorFlow Lite<\/h4>\n<p>  <a href=\"https:\/\/www.tensorflow.org\/lite\">TensorFlow Lite<\/a> \u2014 \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.tensorflow.org\/\">TensorFlow <\/a>\u0432 IoT \u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445.<\/p>\n<p>  TensorFlow Lite \u0438 TensorFlow \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 <a href=\"https:\/\/github.com\/tensorflow\/tensorflow\">open-source \u043d\u0430 GitHub<\/a>.<\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\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 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Azure + Xamarin.Android<\/h2>\n<p>  \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \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 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dhindrik\/MushroomDetector\/\">github.com\/dhindrik\/MushroomDetector<\/a><\/p>\n<h4>1. \u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h4>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0432\u0435\u0431-\u043f\u043e\u0440\u0442\u0430\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Custom Vision<\/a>, \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0431\u0443\u0447\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  1. \u041d\u0430 <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0432\u0435\u0431-\u043f\u043e\u0440\u0442\u0430\u043b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Custom Vision<\/a> \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <b>New Project<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sx\/qn\/kh\/sxqnkh76fpwunev5ap2ez-9mjj8.png\" alt=\"image\"><\/p>\n<p>  2. \u0412 \u043e\u043a\u043d\u0435 <b>Create new project<\/b> \u0432\u044b\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li><b>Name:<\/b> XamarinImageClassification <\/li>\n<li><b>Description:<\/b> Identify Objects in Images <\/li>\n<li><b>Resource:<\/b> [Create a new resource] <\/li>\n<li><b>Project Type:<\/b> Classification <\/li>\n<li><b>Classification Types:<\/b> Multilabel (Multiple tags per image) <\/li>\n<li><b>Domains:<\/b> General (compact) <\/li>\n<li><b>Export Capabilities:<\/b> Basic platforms <\/li>\n<\/ul>\n<p>  3. \u0412 \u043e\u043a\u043d\u0435 <b>Create new project <\/b>\u043d\u0430\u0436\u043c\u0438\u0442\u0435 <b>Create project<\/b><\/p>\n<p>  4. \u0412 \u043e\u043a\u043d\u0435 <b>XamarinImageClassification<\/b> \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <b>Add images<\/b><\/p>\n<p>  5. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/p>\n<p>  6. \u0412 \u043e\u043a\u043d\u0435 <b>Image Upload<\/b> \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u0435\u0433<br \/>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0433\u0440\u0438\u0431\u043e\u0432<\/p>\n<p>  7. \u0412 \u043e\u043a\u043d\u0435 <b>Image upload<\/b> \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <b>Upload<\/b><br \/>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043a\u0430 \u0443 \u0432\u0430\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, 5 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0433\u0430<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cf\/fd\/4m\/cffd4muzbpg6s4htghxencupfvw.png\" alt=\"image\"><\/p>\n<p>  8. \u0412 \u043e\u043a\u043d\u0435 <b>XamarinImageClassification <\/b>\u0432 \u043f\u0440\u0430\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443 \u043e\u043a\u043d\u0430 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 <b>Train Model<\/b> (\u0437\u0435\u043b\u0435\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043e\u043a)<\/p>\n<p>  9. \u0412 \u043e\u043a\u043d\u0435 <b>Choose Training Type<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Quick Training<\/b><\/p>\n<p>  10. \u0412 \u043e\u043a\u043d\u0435 <b>Choose Training Type<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Train<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tq\/2w\/az\/tq2waz6v9a7tvsvxwbaqfdszdbk.png\" alt=\"image\"><\/p>\n<h4>2. \u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Azure Custom Vision<\/h4>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0431\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/custom-vision-service\/export-your-model?WT.mc_id=aiapril-xamblog-bramin\">\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0435 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a>.<\/p>\n<p>  \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0433\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u043a\u0438\u043d\u0443\u0442 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  1. \u0412 \u043e\u043a\u043d\u0435 <b>XamarinImageClassifcation <\/b>\u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 <b>Performance <\/b><\/p>\n<p>  2. \u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 <b>Performace <\/b>\u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 <b>Export <\/b>(\u0441\u0442\u0440\u0435\u043b\u043a\u0430, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u043d\u0438\u0437)<\/p>\n<p>  3. \u0412 \u043e\u043a\u043d\u0435 <b>Choose your platform<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>TensorFlow<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jr\/xg\/in\/jrxginpgpbnk3sswvxexoli9a60.png\" alt=\"image\"><\/p>\n<p>  4. \u0412 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0435 <b>Choose your platform<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>TensorFlow Lite<\/b><\/p>\n<p>  5. \u0412 \u043e\u043a\u043d\u0435 <b>Choose your platform<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Download<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mb\/hr\/qg\/mbhrqg-c8m1d2cngmz2dylwuamk.png\" alt=\"image\"><\/p>\n<h4>3. \u0418\u043c\u043f\u043e\u0440\u0442 TensorFlow Lite \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Xamarin.Android<\/h4>\n<p>  1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/www.nuget.org\/packages\/Xamarin.TensorFlow.Lite\">\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 NuGet<\/a> \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Xamarin.Android<br \/>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u042d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 NuGet \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <a href=\"https:\/\/github.com\/xamarin\/XamarinComponents\/tree\/master\/XPlat\/TensorFlow.Lite\">\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c<\/a>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 Xamarin \u0432 Microsoft. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 C# \u0434\u043b\u044f <a href=\"https:\/\/github.com\/tensorflow\/tensorflow\">\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 TensorFlow Lite<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Xamarin.Android<\/p>\n<p>  2. \u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0439\u0442\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0441 <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0432\u0435\u0431-\u043f\u043e\u0440\u0442\u0430\u043b\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Custom Vision<\/a><br \/>  <b>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0432\u043d\u0443\u0442\u0440\u0438 zip-\u0444\u0430\u0439\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f <i>labels.txt<\/i> \u0438 <i>model.tflite<\/i>:<\/p>\n<ul>\n<li><i>labels.txt<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u0433\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043a \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Custom Vision <\/li>\n<li><i>models.tflite<\/i> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u043e\u0432. <\/li>\n<\/ul>\n<p>  3. \u0412 Visual Studio, \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Xamarin.Android, \u0449\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043f\u0430\u043f\u043a\u0443 <b>Assets <\/b><\/p>\n<p>  4. \u0412\u043e \u0432\u0441\u043f\u043b\u044b\u0432\u0448\u0435\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 <b>Add &gt; Existing Item\u2026<\/b><\/p>\n<p>  5. \u0412 \u043c\u0435\u043d\u044e <b>Add Existing Item<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0431\u0430 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li><b>models.tflite<\/b> <\/li>\n<li><b>labels.txt<\/b> <\/li>\n<\/ul>\n<p>  6. \u0412 Visual Studio, \u0432 <b>Xamarin.Android &gt; Assets<\/b>, \u0449\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 <b>labels.txt<\/b><\/p>\n<p>  7. \u0412\u043e \u0432\u0441\u043f\u043b\u044b\u0432\u0448\u0435\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Properties<\/b><\/p>\n<p>  8. \u0412 \u043e\u043a\u043d\u0435 <b>Properties <\/b>\u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Build Action &gt; Android Asset<\/b><\/p>\n<p>  9. \u0412 Visual Studio, \u0432 <b>Xamarin.Android &gt; Assets<\/b>, \u0449\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 <b>models.tflite<\/b><\/p>\n<p>  10. \u0412\u043e \u0432\u0441\u043f\u043b\u044b\u0432\u0448\u0435\u043c \u043c\u0435\u043d\u044e \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Properties<\/b><\/p>\n<p>  11. \u0412 \u043e\u043a\u043d\u0435 <b>Properties<\/b> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <b>Build Action &gt; Android Asset<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xx\/ez\/af\/xxezafr-mncdulrowkqnxwlhymm.png\" alt=\"image\"><\/p>\n<h4>4. \u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Xamarin.Android<\/h4>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \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 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub: <a href=\"https:\/\/github.com\/dhindrik\/MushroomDetector\/\">github.com\/dhindrik\/MushroomDetector<\/a><\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <b>Xamarin.Android<\/b>, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 <i>ImageClassifcationModel.cs<\/i> \u0438 <i>TensorflowClassifier.cs<\/i>:<\/p>\n<h4>ImageClassificationModel.cs<\/h4>\n<p>  <\/p>\n<pre><code class=\"cs\">public class ImageClassificationModel  {      public ImageClassificationModel(string tagName, float probability)      {          TagName = tagName;          Probability = probability;      }          public float Probability { get; }      public string TagName { get; }  }<\/code><\/pre>\n<p>  <\/p>\n<h4>TensorflowClassifier.cs<\/h4>\n<p>  <\/p>\n<pre><code class=\"cs\">using System.Collections.Generic; using System.IO; using System.Linq; using Android.App; using Android.Graphics; using Java.IO; using Java.Nio; using Java.Nio.Channels;  public class TensorflowClassifier {     \/\/FloatSize \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 4, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 4 \u0431\u0430\u0439\u0442\u0430     const int FloatSize = 4;     \/\/PixelSize - \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 3, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0443 \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0446\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043a\u0430\u043d\u0430\u043b\u0430: \u043a\u0440\u0430\u0441\u043d\u044b\u0439, \u0437\u0435\u043b\u0435\u043d\u044b\u0439 \u0438 \u0441\u0438\u043d\u0438\u0439.     const int PixelSize = 3;      public List&lt;ImageClassificationModel&gt; Classify(byte[] image)     {         var mappedByteBuffer = GetModelAsMappedByteBuffer();         var interpreter = new Xamarin.TensorFlow.Lite.Interpreter(mappedByteBuffer);          \/\/\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u0438 \u0432\u044b\u0441\u043e\u0442\u0443         var tensor = interpreter.GetInputTensor(0);         var shape = tensor.Shape();          var width = shape[1];         var height = shape[2];          var byteBuffer = GetPhotoAsByteBuffer(image, width, height);          \/\/\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 StreamReader \u0434\u043b\u044f \u0438\u043d\u043f\u043e\u0440\u0442\u0430 \u0438\u0437 labels.txt         var streamReader = new StreamReader(Application.Context.Assets.Open(&quot;labels.txt&quot;));          \/\/\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 labels.txt \u0432 List&lt;string&gt;         var labels = streamReader.ReadToEnd().Split('\\n').Select(s =&gt; s.Trim()).Where(s =&gt; !string.IsNullOrEmpty(s)).ToList();          \/\/\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 \u043d\u0430\u0448 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 Java.Lang.Object, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0432\u043e\u0434 \u0434\u043b\u044f Xamarin.TensorFlow.List.Interpreter.         var outputLocations = new float[1][] { new float[labels.Count] };         var outputs = Java.Lang.Object.FromArray(outputLocations);          interpreter.Run(byteBuffer, outputs);         var classificationResult = outputs.ToArray&lt;float[]&gt;();          \/\/\u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 classificationResult \u0441 \u043c\u0435\u0442\u043a\u0430\u043c\u0438 \u0438 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u043c\u0435\u0442\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c         var classificationModelList = new List&lt;ImageClassificationModel&gt;();          for (var i = 0; i &lt; labels.Count; i++)         {             var label = labels[i]; classificationModelList.Add(new ImageClassificationModel(label, classificationResult[0][i]));         }          return classificationModelList;     }      \/\/\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 model.tflite \u0432 Java.Nio.MappedByteBuffer, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0434\u043b\u044f Xamarin.TensorFlow.Lite.Interpreter.     private MappedByteBuffer GetModelAsMappedByteBuffer()     {         var assetDescriptor = Application.Context.Assets.OpenFd(&quot;model.tflite&quot;);         var inputStream = new FileInputStream(assetDescriptor.FileDescriptor);          var mappedByteBuffer = inputStream.Channel.Map(FileChannel.MapMode.ReadOnly, assetDescriptor.StartOffset, assetDescriptor.DeclaredLength);          return mappedByteBuffer;     }      \/\/\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 TensorFlow     private ByteBuffer GetPhotoAsByteBuffer(byte[] image, int width, int height)     {         var bitmap = BitmapFactory.DecodeByteArray(image, 0, image.Length);         var resizedBitmap = Bitmap.CreateScaledBitmap(bitmap, width, height, true);          var modelInputSize = FloatSize * height * width * PixelSize;         var byteBuffer = ByteBuffer.AllocateDirect(modelInputSize);         byteBuffer.Order(ByteOrder.NativeOrder());          var pixels = new int[width * height];         resizedBitmap.GetPixels(pixels, 0, resizedBitmap.Width, 0, 0, resizedBitmap.Width, resizedBitmap.Height);          var pixel = 0;          \/\/\u041f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Java.Nio.ByteBuffer         for (var i = 0; i &lt; width; i++)         {             for (var j = 0; j &lt; height; j++)             {                 var pixelVal = pixels[pixel++];                  byteBuffer.PutFloat(pixelVal &gt;&gt; 16 &amp; 0xFF);                 byteBuffer.PutFloat(pixelVal &gt;&gt; 8 &amp; 0xFF);                 byteBuffer.PutFloat(pixelVal &amp; 0xFF);             }         }          bitmap.Recycle();          return byteBuffer;     } }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435! \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 <i>TensorflowClassifier.Classify<\/i>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <i>ImageClassificationModel<\/i>.<\/p>\n<h2>\u041c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0434\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0438\u0436\u0435:  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dhindrik\/MushroomDetector\/blob\/master\/MushroomDetector.Android\/TensorflowClassifier.cs\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 GitHub<\/a> <\/li>\n<li><a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0421\u0435\u0440\u0432\u0438\u0441 Azure Custom Vision<\/a> <\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/azure\/cognitive-services?WT.mc_id=aiapril-xamblog-bramin\">Azure Cognitive Services<\/a> <\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=pRDL5BtV_Fg&amp;feature=youtu.be\">The Community AI Show: Custom Vision, Xamarin and Simpsons<\/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\/microsoft\/blog\/494782\/\"> https:\/\/habr.com\/ru\/company\/microsoft\/blog\/494782\/<\/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\/microsoft\/blog\/494782\/\">\u041a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c Xamarin \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043d\u0430 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\u0445. <\/p>\n<p>  \u0412\u0441\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u043d\u0430\u0448\u0438\u0445 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0435\u043f\u043e\u0437\u0438\u0442\u0430, \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u0444\u043e\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 HotDog, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043d\u0430\u0448\u0430 \u0435\u0434\u0430 \u0445\u043e\u0442-\u0434\u043e\u0433\u043e\u043c.<\/p>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0443 Azure Custom Vision \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/customvision.ai\/?WT.mc_id=aiapril-xamblog-bramin\">\u0441\u0435\u0440\u0432\u0438\u0441\u0430 Azure Custom Vision<\/a>, <a href=\"https:\/\/www.tensorflow.org\/lite\">TensorFlow Lite<\/a> (\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c) \u0438 <a href=\"https:\/\/docs.microsoft.com\/xamarin\/android?WT.mc_id=aiapril-xamblog-bramin\">Xamarin.Android<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w6\/7s\/is\/w67sispgfa1h0zaexrrmfixvnjm.jpeg\"><\/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-301407","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301407","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=301407"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301407\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}