{"id":300645,"date":"2020-03-24T09:00:37","date_gmt":"2020-03-24T09:00:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300645"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300645","title":{"rendered":"\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c GAN \u0441\u0435\u0442\u0438 \u0432 OpenVINO"},"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\/intel\/blog\/492812\/\">\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 <a href=\"https:\/\/github.com\/opencv\/open_model_zoo\">Open Model Zoo<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenVINO \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e). \u041d\u043e \u043d\u0430\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u043e\u0441\u044c GAN \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u044b \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0443\u043c\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432 Keras \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0435 \u0432 OpenVINO.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/up\/vd\/aq\/upvdaqhcjnmtbsl8ekakezv7wxc.png\" alt=\"Intro image\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"sovsem-nemnogo-pro-gan-seti\">\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e GAN \u0441\u0435\u0442\u0438<\/h2>\n<p>  <\/p>\n<p>\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e-\u0441\u043e\u0441\u0442\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 (GAN) \u043f\u0440\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0437 \u0448\u0443\u043c\u0430 \u0438\u043b\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435, \u0430 \u043d\u0435 \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435. GAN \u0441\u0435\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435;<\/li>\n<li>\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043f\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e;<\/li>\n<li>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043c\u043e\u0434\u0436\u0438 \u043f\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438;<\/li>\n<li>\u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li>\u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0442\u0438\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li>\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439;<\/li>\n<li>\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043b\u0438\u0446 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435-\u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0442\u0440\u0435\u043d\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 <del>\u043a\u043e\u0448\u043a\u0430\u0445<\/del> \u0446\u0438\u0444\u0440\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e OpenVINO \u0443\u043c\u0435\u0435\u0442 \u0432 GAN \u0441\u0435\u0442\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"generaciya-izobrazheniy-cifr-s-pomoschyu-gan\">\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0446\u0438\u0444\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GAN<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c\u043a\u0443 \u043d\u0430 Keras, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0438\u0444\u0440\u044b, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0446\u0438\u0444\u0440\u0430\u043c \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 MNIST. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0435\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0432 OpenVINO \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0430\u0436\u0435 \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u0440\u0443\u0442\u044b\u0435 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 GAN \u0441\u0435\u0442\u0438 \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u043d\u0430\u043c \u043d\u0435 \u043f\u043e \u0437\u0443\u0431\u0430\u043c. \u0421\u0435\u0442\u043a\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0447\u0442\u043e \u0435\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u043d\u0430 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u043e\u0439 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 NVIDIA \u0441\u0432\u043e\u0435\u0433\u043e \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u0444\u0440 \u043d\u0430 Keras \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/neurohive.io\/ru\/tutorial\/simple-gan-python-keras\/\">\u0437\u0434\u0435\u0441\u044c<\/a>: \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 GAN \u0441\u0435\u0442\u0438 \u043f\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u0444\u0440 \u043d\u0430 Keras \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/alexmasterdi\/Dnn\/tree\/GAN\">\u0443 \u0410\u043b\u0435\u043a\u0441\u0435\u044f<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u0444\u0440, \u0443\u0436\u0435 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 OpenVINO, \u0438 \u043a\u043e\u0434 \u0434\u043b\u044f \u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 OpenVINO \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b <a href=\"https:\/\/github.com\/itlab-vision\/OpenVINO-GAN-DEMO\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u041c\u043e\u0434\u0435\u043b\u044c \u0432\u0435\u0441\u043e\u043c \u0432\u0441\u0435\u0433\u043e \u0432 5 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0446\u0438\u0444\u0440\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ve\/ip\/hm\/veiphmzje0oibmtad6tjykyg2mi.png\" alt=\"Digits matrix\"><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e GAN \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u043e \u0441 \u0446\u0438\u0444\u0440\u0430\u043c\u0438 \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043c\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0431\u043e\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/github.com\/zalandoresearch\/fashion-mnist\">Fashion MNIST<\/a> \u2014 \u043e\u043d \u0442\u043e\u0436\u0435 \u043b\u0435\u0433\u043a\u0438\u0439 \u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u2014 \u0432\u0435\u0434\u044c \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0438\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u0434\u0435\u0436\u0434\u044b \u0438 \u043e\u0431\u0443\u0432\u0438. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0430\u043a\u0438\u0435 \u043d\u043e\u0432\u044b\u0435 \u0434\u0438\u0437\u0430\u0439\u043d\u044b \u0432\u044b\u0434\u0430\u0441\u0442 \u0432\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c?<\/p>\n<p>  <\/p>\n<h2 id=\"konvertaciya-modeli-v-format-openvino\">\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 OpenVINO<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 OpenVINO \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432: Caffe, Tensorflow, ONNX \u0438 \u0442.\u0434. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437 Keras, \u043c\u044b \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0435 \u0432 ONNX, \u0430 \u0438\u0437 ONNX \u0443\u0436\u0435 \u0432 OpenVINO. \u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Keras-&gt;ONNX-&gt;OpenVINO \u043d\u0435\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043b\u044e\u0434\u044f\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c Keras-&gt;TensorFlow-&gt;OpenVINO. \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e ONNX \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0438\u043f\u043e\u0432 \u0441\u043b\u043e\u0435\u0432, \u0447\u0435\u043c Tensorflow, \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<p>Python \u043a\u043e\u0434 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 Keras \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 ONNX:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import numpy as np import argparse import onnx import keras2onnx from keras.models import load_model  model = load_model('gan_digits.h5') onnx_model = keras2onnx.convert_keras(model, model.name) onnx.save_model(onnx_model, 'gan_digits.onnx')<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0439 ONNX \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 OpenVINO (\u0434\u043b\u044f Windows) \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 Model Optimizer:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">python &quot;C:\\Program Files (x86)\\IntelSWTools\\openvino\\deployment_tools\\model_optimizer\\mo.py&quot; --input_model gan_digits.onnx --input_shape [100,100]<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u044c, \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 OpenVINO. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import numpy as np import sys import matplotlib.pyplot as plt from openvino.inference_engine import IENetwork, IECore  # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c OpenVINO \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c ie = IECore() net = IENetwork(model='gan_digits_R2020.1.xml', weights='gan_digits_R2020.1.bin') exec_net = ie.load_network(net, 'CPU') input_blob = next(iter(net.inputs)) out_blob = next(iter(net.outputs))  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441 \u0434\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438\u0437 \u0448\u0443\u043c\u0430 noise = np.random.normal(loc=0, scale=1, size=[100, 100]) generated_images = exec_net.infer(inputs={input_blob: noise})  # \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 generated_images = generated_images['Tanh'] generated_images = generated_images.reshape(100, 28, 28) figsize = (10, 10) dim = (10, 10) plt.figure(figsize=figsize) for i in range(generated_images.shape[0]):     plt.subplot(dim[0], dim[1], i + 1)     plt.imshow(generated_images[i], interpolation='nearest', cmap='gray_r')     plt.axis('off') plt.tight_layout() plt.show()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u0436\u0435 \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u0442 \u0432\u0441\u0435\u0439 \u043c\u043e\u0449\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0432 \u0437\u0430\u0434\u0430\u0447\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0442\u0435\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0443\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043d\u0430 100%.<\/p>\n<p>  <\/p>\n<h2 id=\"posleslovie\">\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432 OpenVINO \u043f\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043b\u0438\u0446. \u0422\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435, \u0430 OpenVINO \u043f\u043e\u043c\u043e\u0433 \u0431\u044b \u0441 \u0438\u0445 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441\u043e\u043c, \u0432\u0435\u0434\u044c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u043e\u043d \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043b\u0438\u0446, \u0447\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/NVlabs\/stylegan\">styleGAN<\/a>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0442:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zz\/8i\/qf\/zz8iqfmzuz8csnzvh_czorzckca.png\" alt=\"styleGAN\"><\/p>\n<p>  <\/p>\n<p>\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c styleGAN \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b \u043e\u0442 NVIDIA \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0447\u0442\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u0432\u0441\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 GitHub \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 <a href=\"https:\/\/github.com\/rosinality\/style-based-gan-pytorch?files=1\">\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a\u0436\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043b\u0438\u0446\u0430 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0435\u0437 GPU. \u0418\u043c\u0435\u043d\u043d\u043e \u0435\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u0437\u044f\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 OpenVINO.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043d\u0430\u0448\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u043f\u0440\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u0441\u0435\u0442\u0438 \u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c PyTorch \u043c\u043e\u0434\u0435\u043b\u044c \u0432 ONNX \u0444\u043e\u0440\u043c\u0430\u0442 (\u0442\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 OpenVINO). \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u0432\u044b\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u043c\u043e\u0447\u044c, \u0442\u043e \u043c\u044b \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u0442\u0430\u0442\u044c\u044e!<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u043e\u0431\u0435\u0439\u043d\u0438\u043a\u043e\u0432 \u0410\u043b\u0435\u043a\u0441\u0435\u0439, \u0420\u0443\u0441\u0442\u0430\u043c\u043e\u0432 \u0410\u0437\u0435\u0440, \u0412\u0430\u0441\u0438\u043b\u044c\u0435\u0432 \u0415\u0432\u0433\u0435\u043d\u0438\u0439.<br \/>  <a href=\"https:\/\/github.com\/itlab-vision\/OpenVINO-GAN-DEMO\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e<\/a>.<\/p>\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\/intel\/blog\/492812\/\"> https:\/\/habr.com\/ru\/company\/intel\/blog\/492812\/<\/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\/intel\/blog\/492812\/\">\n<p>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 <a href=\"https:\/\/github.com\/opencv\/open_model_zoo\">Open Model Zoo<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 OpenVINO \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0437\u0440\u0435\u043d\u0438\u044f (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e). \u041d\u043e \u043d\u0430\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u043e\u0441\u044c GAN \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0431\u044b \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0448\u0443\u043c\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0432 Keras \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0435 \u0432 OpenVINO.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/up\/vd\/aq\/upvdaqhcjnmtbsl8ekakezv7wxc.png\" alt=\"Intro image\"><\/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-300645","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300645","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=300645"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300645\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}