{"id":2246,"date":"2018-11-12T06:12:53","date_gmt":"2018-11-11T21:12:53","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2246"},"modified":"2020-03-19T02:16:52","modified_gmt":"2020-03-18T17:16:52","slug":"electron-python-%e3%81%a7%e9%81%b8%e3%82%93%e3%81%a0%e9%a1%94%e3%81%ab%e3%83%a2%e3%82%b6%e3%82%a4%e3%82%af%e3%82%92%e3%81%8b%e3%81%91%e3%82%8b%e3%82%a2%e3%83%97%e3%83%aa%ef%bc%88%e3%83%80%e3%82%a6","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2246","title":{"rendered":"Electron + Python \u3067\u9078\u3093\u3060\u9854\u306b\u30e2\u30b6\u30a4\u30af\u3092\u304b\u3051\u308b\u30a2\u30d7\u30ea\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u3068\u3053\u308d<code>Electron<\/code>\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u9762\u767d\u304f\u306a\u3063\u3066\u304d\u3066\u500b\u4eba\u7684\u306b\u3082\u3044\u308d\u3044\u308d\u3068\u958b\u767a\u3059\u308b\u610f\u6b32\u304c\u6e67\u3044\u3066\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306a\u4e2d\u3067\u81ea\u7136\u3068\u8a66\u3057\u305f\u3044\u3053\u3068\u304c\u982d\u306b\u6d6e\u304b\u3093\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong>\u4ed6\u306e\u8a00\u8a9e\u3068\u306e\u30b3\u30e9\u30dc\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<code>Electron<\/code>\u306f<code>NodeJS<\/code>\uff08JavaScript\uff09\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u5358\u4f53\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4f8b\u3048\u3070\u3001<code>Python<\/code>\u3084\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306a\u3069\u3082\u5b9f\u884c\u3057\u3066\u307f\u305f\u304f\u306a\u3063\u305f\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u4ee5\u524d\u8a66\u3057\u3066\u307f\u305f\uff08\u3068\u3044\u3063\u3066\u3082\u79fb\u8ee2\u524d\u306e\u30d6\u30ed\u30b0\u3067\u3059\u304c\uff09<code>Python<\/code> + <code>dlib<\/code>\u306e\u9854\u8a8d\u8a3c\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b<code>Electron<\/code>\u30a2\u30d7\u30ea\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u5b66\u7fd2\u306e\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2247 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2.png\" alt=\"\" width=\"320\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2.png 320w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2-300x300.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/2-100x100.png 100w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/p>\n<p>\u203b \u958b\u767a\u74b0\u5883\uff1a Electron 2.0\u3001Python 2.7<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u305b\u3063\u304b\u304f<code>Electron<\/code>\u3092\u4f7f\u3046\u306e\u3067\u3001\u5358\u7d14\u306b\u691c\u51fa\u3055\u308c\u305f\u5168\u3066\u306e\u9854\u306b\u30e2\u30b6\u30a4\u30af\u3092\u304b\u3051\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ea\u3067\u306f\u306a\u304f\u3001\u6b21\u306e\u3088\u3046\u306b\u30e2\u30b6\u30a4\u30af\u3092\u304b\u3051\u308b\u9854\u753b\u50cf\u3092\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u753b\u50cf\u3092\u9078\u629e\u3059\u308b<\/li>\n<li>\u753b\u50cf\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u9854\u3092\u3059\u3079\u3066\u62bd\u51fa<\/li>\n<li>\u30e2\u30b6\u30a4\u30af\u3092\u304b\u3051\u305f\u3044\u9854\u3092\u30c1\u30a7\u30c3\u30af<\/li>\n<li>\u5b9f\u884c\uff08\u9078\u3093\u3060\u9854\u3060\u3051\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b\uff09<\/li>\n<\/ol>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>Electron\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=2054\">\u521d\u5fc3\u8005\u5411\u304d\uff01electron \u3067\u7c21\u5358\u306a\u30e1\u30e2\u5e33\u3092\u3064\u304f\u3063\u3066\u307f\u3088\u3046<\/a>\u306e <strong>&#8220;electron\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb&#8221;<\/strong> \u306b\u8a73\u3057\u304f\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30d5\u30a9\u30eb\u30c0\u540d\u306f<code>pixelate_face<\/code>\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2248\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-17-11-26.png\" alt=\"\" width=\"224\" height=\"134\" \/><\/p>\n<h1>Python\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h1>\n<p>Python\u30b3\u30fc\u30c9\u3067\u5fc5\u8981\u306b\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u6b21\u306e\uff12\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>detect_face.py\u3000\u30fb\u30fb\u30fb\u3000\u9854\u3092\u691c\u51fa\u3059\u308b<\/li>\n<li>pixelate_face.py\u3000\u30fb\u30fb\u30fb\u3000\u9854\u306b\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3059\u308b<\/li>\n<\/ul>\n<h2>\u9854\u691c\u51fa\u306b\u5fc5\u8981\u306a\u74b0\u5883\u3092\u6574\u3048\u308b<\/h2>\n<p>\u307e\u305a\u5fc5\u8981\u3068\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092<code>pip<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>pip install opencv-python\r\npip install dlib\r\n<\/strong><\/pre>\n<p>\u203b \u3082\u3057<code>dlib<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u30a8\u30e9\u30fc\u304c\u3067\u308b\u3088\u3046\u306a\u3089\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=1957\">\u30b3\u30fc\u30c9\u5fc5\u8981\u306a\u3057\uff012D\u306e\u9854\u753b\u50cf\u30923D\u5316\u3059\u308bPython\u30b3\u30fc\u30c9\uff08PRNet\uff09<\/a> \u306e\u300c\u5b9f\u884c\u306b\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb &gt; dlib\u300d\u3092\u53c2\u8003\u306b\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u9854\u691c\u51fa\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u753b\u50cf\u304b\u3089\u9854\u3092\u691c\u51fa\u3057\u3001\u305d\u308c\u304c\u3069\u3053\u306b\u3042\u308b\u304b\u3092\u53d6\u5f97\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u60f3\u5b9a\u3057\u3066\u3044\u308b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<pre><strong>python detect_face.py -i \"(\u753b\u50cf\u306e\u30d1\u30b9)\"<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre>#!\/usr\/bin\/python\r\n\r\nimport cv2\r\nimport dlib\r\nimport argparse\r\nimport json\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument('-i', help='required', type=str)\r\nargs = parser.parse_args()\r\npath = args.i\r\ndetector = dlib.get_frontal_face_detector()\r\n<strong>im = cv2.imread(path, cv2.IMREAD_COLOR)<\/strong>\r\n\r\nif im is None:\r\n    exit()\r\n\r\n<strong>rects = detector(im, 1)<\/strong>\r\nif len(rects) == 0:\r\n\u00a0   exit()\r\n\r\n<strong>faces = []<\/strong>\r\n<strong>for rect in rects:<\/strong>\r\n<strong>\u00a0   faces.append({<\/strong>\r\n<strong>        'top': int(rect.top()),<\/strong>\r\n<strong>        'left': int(rect.left()),<\/strong>\r\n<strong>        'width': int(rect.width()),<\/strong>\r\n<strong>        'height': int(rect.height())<\/strong>\r\n<strong>\u00a0   })<\/strong>\r\n<strong>print(json.dumps(faces))<\/strong><\/pre>\n<p>\u307e\u305a\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u307f\u3001\u9854\u30c7\u30fc\u30bf\u3092<code>detector()<\/code>\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u3042\u3068\u306f\u3001\u53d6\u5f97\u3055\u308c\u305f\u9854\u30c7\u30fc\u30bf\u304b\u3089\u5fc5\u8981\u306a\u90e8\u5206\u3092\u53d6\u308a\u51fa\u3057\u3001\u6700\u5f8c\u306eJSON\u306b\u3057\u3066\u8868\u793a\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<h2>\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6b21\u306b\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u306e\u4ed5\u65b9\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=1990\">opencv \u306e\u57fa\u672c\u7684\u306a\u753b\u50cf\u5909\u5f62\uff1a \u516812\u5b9f\u4f8b\uff01<\/a>\u3067\u7d39\u4ecb\u3057\u3066\u3044\u308b\u3082\u306e\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre>#!\/usr\/bin\/python\r\n\r\nimport cv2\r\nimport json\r\nimport os\r\nimport argparse\r\n\r\n<strong>PIXEL_RATIO = 0.01<\/strong>\r\n\r\nparser = argparse.ArgumentParser()\r\nparser.add_argument('-i', help='required', type=str)\r\nparser.add_argument('-p', help='required', type=str)\r\nargs = parser.parse_args()\r\npath = args.i\r\n<strong>faces = json.loads(args.p)<\/strong>\r\n\r\nim = cv2.imread(path, cv2.IMREAD_COLOR)\r\nrows,cols = im.shape[:2]\r\n\r\n<strong>for face in faces:<\/strong>\r\n    x = face['left']\r\n\u00a0   y = face['top']\r\n\u00a0   width = face['width']\r\n\u00a0   height = face['height']\r\n\u00a0   block_im = im[y:y+height, x:x+width]\r\n\u00a0   pixel_x = int(cols*PIXEL_RATIO)\r\n\u00a0   pixel_y = int(rows*PIXEL_RATIO)\r\n\u00a0   small_im = cv2.resize(block_im, (pixel_x, pixel_y), interpolation=cv2.INTER_NEAREST)\r\n\u00a0   mosaic_im = cv2.resize(small_im, (width, height), interpolation=cv2.INTER_NEAREST)\r\n\u00a0   im[y:y+height, x:x+width] = mosaic_im\r\n\r\nsave_path = os.path.dirname(path) +'\/pixelated-'+ os.path.basename(path)\r\ncv2.imwrite(save_path, im)\r\nprint('pixelated')<\/pre>\n<p>\u307e\u305a\u59cb\u3081\u306e<code>PIXEL_RATIO<\/code>\u3068\u3044\u3046\u306e\u306f\u3001\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u306e\u5ea6\u5408\u3044\u3092\u8a2d\u5b9a\u3059\u308b\u5b9a\u6570\u3067\u3001\u5c0f\u3055\u3044\u6570\u5b57\u307b\u3069\u30e2\u30b6\u30a4\u30af\u304c\u304d\u3064\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u9854\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f<code>Electron<\/code>\u5074\u304b\u3089JSON\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u3089\u3092\u30eb\u30fc\u30d7\u3055\u305b\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3055\u308c\u305f\u753b\u50cf\u306f\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>Electron\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h1>\n<h2>\u30a2\u30d7\u30ea\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/h2>\n<p>\u4eca\u56de\u306f\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u30b5\u30a4\u30ba\u3068\u4f4d\u7f6e\u3001\u305d\u3057\u3066\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc\u3092\u975e\u8868\u793a\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>\/\/ main.js\r\n\r\nmainWindow = new BrowserWindow({<\/strong>\r\n<strong>    width: 400,<\/strong>\r\n<strong>    height: 400,<\/strong>\r\n<strong>    x: 0,<\/strong>\r\n<strong>    y: 0,<\/strong>\r\n<strong>    autoHideMenuBar: true,\r\n    webPreferences: {\r\n        preload: path.join(__dirname, 'preload.js'), \r\n        nodeIntegration: true\r\n    }<\/strong>\r\n<strong>})<\/strong><\/pre>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.3.19\u3011<\/strong><code>Electron v5<\/code>\u4ee5\u964d\u306e\u305f\u3081\u306b<code>webPreferences<\/code>\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p>\u4eca\u56de\u306f<code>Vue.js<\/code>\u3068<code>axios<\/code>\u3001\u305d\u3057\u3066<code>bootstrap<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>npm i vue --save\r\nnpm i axios --save\r\nnpm i bootstrap --save<\/strong><\/pre>\n<h2>\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30a2\u30d7\u30ea\u306b\u8868\u793a\u3055\u308c\u308b\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=\"UTF-8\"&gt;\r\n    &lt;title&gt;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u30a2\u30d7\u30ea\uff01&lt;\/title&gt;\r\n    <strong>&lt;link rel=\"stylesheet\" href=\".\/node_modules\/bootstrap\/dist\/css\/bootstrap.min.css\"&gt;<\/strong>\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n<strong>&lt;div id=\"app\" class=\"container\"&gt;<\/strong>\r\n<strong>    &lt;label style=\"margin-top:15px;\"&gt;<\/strong>\r\n<strong>        &lt;span class=\"btn btn-light\"&gt;<\/strong>\r\n<strong>            \u753b\u50cf\u3092\u9078\u629e<\/strong>\r\n<strong>            &lt;input<\/strong>\r\n<strong>                type=\"file\"<\/strong>\r\n<strong>                style=\"display:none\"<\/strong>\r\n<strong>                accept=\"image\/*\"&gt;<\/strong>\r\n<strong>        &lt;\/span&gt;<\/strong>\r\n<strong>    &lt;\/label&gt;<\/strong>\r\n<strong>    &lt;hr&gt;<\/strong>\r\n<strong>    &lt;span class=\"badge badge-pill badge-dark\"&gt;\u62bd\u51fa\u3055\u308c\u305f\u9854&lt;\/span&gt;<\/strong>\r\n<strong>    &lt;div&gt;\u691c\u51fa\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002&lt;\/div&gt;<\/strong>\r\n<strong>    &lt;button type=\"button\" class=\"btn btn-danger btn-sm\" style=\"position:absolute;right:15px;bottom:15px;\"&gt;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b&lt;\/button&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n&lt;script&gt;\r\n    require('.\/renderer.js')\r\n&lt;\/script&gt;\r\n<strong>&lt;script src=\".\/node_modules\/vue\/dist\/vue.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\".\/node_modules\/axios\/dist\/axios.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n&lt;script&gt;\r\n\r\n    new Vue({\r\n        el: '#app',\r\n        methods: {\r\n            onImageChanged(e) {\r\n                const files = e.target.files\r\n            }\r\n        }\r\n    })\r\n\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u5b9f\u884c\u3057\u305f\u3082\u306e\u304c\u3053\u3061\u3089\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2253\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-19-44-12.png\" alt=\"\" width=\"402\" height=\"432\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-19-44-12.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-19-44-12-279x300.png 279w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p>\u203b \u3082\u3057\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u306b\u9854\u304c\u542b\u307e\u308c\u3066\u3044\u305f\u3089\u3001\u300c\u691c\u51fa\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u300d\u306e\u90e8\u5206\u306b\u305d\u306e\u9854\u3092\u8868\u793a\u3055\u305b\u3066\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<h2>JavaScript\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h2>\n<h3>\u753b\u50cf\u9078\u629e\u90e8\u5206<\/h3>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f &#8220;\u753b\u50cf\u3092\u9078\u629e&#8221; \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u6642\u306b<code>onImageChanged()<\/code>\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;span class=\"btn btn-light\"&gt;\r\n    \u753b\u50cf\u3092\u9078\u629e\r\n    &lt;input\r\n        type=\"file\"\r\n        style=\"display:none\"\r\n        accept=\"image\/*\"\r\n        <strong>@change=\"onImageChanged($event)\"<\/strong>&gt;\r\n&lt;\/span&gt;<\/pre>\n<p><code>onImageChanged()<\/code>\u672c\u4f53\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>const {spawn} = require('child_process');<\/strong><\/pre>\n<pre><strong>onImageChanged(e)<\/strong> {\r\n    this.imagePath = ''\r\n    const files = e.target.files\r\n    if(files.length &gt; 0) {\r\n        this.faces = []\r\n        const file = files[0]\r\n        const path = file.path\r\n        const target = __dirname +'\/python\/detect_face.py'\r\n        const command = '<strong>\/usr\/bin\/python<\/strong> \"'+ target +'\" -i \"'+ path +'\"'\r\n        const process = spawn('<strong>\/bin\/sh<\/strong>', ['-c', command])\r\n        process.stdout.on('data', (data) =&gt; {\r\n            if(data != '') {\r\n                <strong>this.faces = JSON.parse(data)<\/strong>\r\n            }\r\n        });\r\n        this.imagePath = path\r\n    }\r\n}<\/pre>\n<p>\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u304c\u3001<code>spawn()<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u3053\u3053\u3067\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001<code>\/bin\/sh<\/code>\u3084<code>\/usr\/bin\/python<\/code>\u306f\u74b0\u5883\u306b\u5bc4\u3063\u3066\u5909\u308f\u3063\u3066\u304f\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u5834\u5408\u306f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067<code>which sh<\/code>\u3084<code>which python<\/code>\u3068\u3057\u3066\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002\uff08\u3082\u3057\u304f\u306f\u30a2\u30d7\u30ea\u8d77\u52d5\u6642\u306b\u3053\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u81ea\u52d5\u53d6\u5f97\u3057\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305f\u3060\u3001\u4eca\u56de\u306f\u7701\u7565\u3057\u307e\u3059\uff09<\/p>\n<p>\u307e\u305f\u3001<code>imagePath<\/code>\u306f\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u3078\u306e\u30d1\u30b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u691c\u51fa\u3055\u308c\u305f\u9854\u3092\u8868\u793a\u3059\u308b\u90e8\u5206<\/h2>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u306e\u30b3\u30fc\u30c9\u3067\u691c\u51fa\u3055\u308c\u305f\u9854\u30c7\u30fc\u30bf\u304c\u5165\u308b\u5909\u6570<code>faces<\/code>\u3001\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u30d1\u30b9\u304c\u5165\u3063\u3066\u304f\u308b<code>imagePath<\/code>\u3092\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>data: {\r\n    <strong>faces: [],<\/strong>\r\n<strong>    imagePath: ''<\/strong>\r\n},<\/pre>\n<p>\u6b21\u306b<code>computed<\/code>\u306b\u691c\u51fa\u3055\u308c\u305f\u9854\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b<code>hasFace<\/code>\u3068\u3044\u3046\u7591\u4f3c\u5909\u6570\u3082\u767b\u9332\u3057\u3066\u3053\u308c\u3092\u4f7f\u3063\u3066\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u5207\u308a\u66ff\u3048\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre>computed: {\r\n    <strong>hasFace() {<\/strong>\r\n<strong>        return (this.faces.length &gt; 0)<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<pre>&lt;div <strong>v-if=\"!hasFace\"<\/strong>&gt;\u691c\u51fa\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002&lt;\/div&gt;\r\n&lt;div <strong>v-else<\/strong>&gt;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b\u9854\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002&lt;\/div&gt;<\/pre>\n<pre>&lt;button\r\n    type=\"button\"\r\n    class=\"btn btn-danger btn-sm\"\r\n    style=\"position:absolute;right:15px;bottom:15px;\"\r\n    <strong>:disabled=\"!hasFace\"<\/strong>&gt;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b&lt;\/button&gt;<\/pre>\n<p>\u3053\u308c\u3067\u3001\u9854\u30c7\u30fc\u30bf\u304c\u691c\u51fa\u3055\u308c\u305f\u6642\u3068\u305d\u3046\u3067\u306a\u3044\u6642\u3067\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u81ea\u52d5\u3067\u5909\u66f4\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\uff08\u691c\u51fa\u3055\u308c\u3066\u306a\u3044\u6642\uff09<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2255\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-20-04-12.png\" alt=\"\" width=\"402\" height=\"432\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-20-04-12.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-20-04-12-279x300.png 279w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p><strong>\uff08\u691c\u51fa\u3055\u308c\u305f\u6642\uff09<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2256\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-20-04-03.png\" alt=\"\" width=\"402\" height=\"432\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-20-04-03.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-20-04-03-279x300.png 279w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p>\u3067\u306f\u3001\u7d9a\u3044\u3066\u53d6\u5f97\u3055\u308c\u305f\u9854\u30c7\u30fc\u30bf\u306e\u4e00\u89a7\u3092\u8868\u793a\u3057\u3001\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;div class=\"float-left\" style=\"margin:5px;\" <strong>v-for=\"(face,index) in faces\"<\/strong>&gt;\r\n    &lt;label class=\"text-center\"&gt;\r\n        &lt;input type=\"checkbox\"&gt;\r\n        &lt;div <strong>:style=\"faceStyle(face)\"<\/strong>&gt;&lt;\/div&gt;\r\n    &lt;label&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>\u307e\u305a\u306f\u9854\u30c7\u30fc\u30bf<code>faces<\/code>\u3092<code>v-for<\/code>\u3067\u30eb\u30fc\u30d7\u3055\u305b\uff11\u3064\u305a\u3064\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u9078\u629e\u7528\u306e<code>checkbox<\/code>\u3068\u9854\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<code>&lt;div&gt;<\/code>\u30bf\u30b0\u3092\u7528\u610f\u3057\u3001\u80cc\u666f\u306b\u9078\u629e\u3055\u308c\u305f\u753b\u50cf\u3092\u8868\u793a\u3057\u3001\u4f4d\u7f6e\u3092\u305a\u3089\u3059\u3053\u3068\u3067\u9854\u3060\u3051\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>faceStyle(face) {\r\n    return <strong>{<\/strong>\r\n<strong>        width: face.width +'px',<\/strong>\r\n<strong>        height: face.height +'px',<\/strong>\r\n<strong>        border: '1px solid #ccc',<\/strong>\r\n<strong>        backgroundImage: 'url('+ this.imagePath +')',<\/strong>\r\n<strong>        backgroundPositionX: '-'+ face.left +'px',<\/strong>\r\n<strong>        backgroundPositionY: '-'+ face.top +'px'<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u5b9f\u969b\u306b\u9854\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u5229\u7528\u3059\u308b\u306e\u306f<code>pixabay<\/code>\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u305f\u3001\u3053\u306e\uff08\u5e78\u305b\u3092\u7d75\u306b\u63cf\u3044\u305f\u3088\u3046\u306a ^^\uff09\u5bb6\u65cf\u306e\u753b\u50cf\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2257\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/faces.jpg\" alt=\"\" width=\"457\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/faces.jpg 457w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/faces-214x300.jpg 214w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<p>\u7d50\u679c\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2258\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-21-11-15.png\" alt=\"\" width=\"402\" height=\"432\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-21-11-15.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-21-11-15-279x300.png 279w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p>\uff15\u4eba\u5168\u3066\u306e\u9854\u3092\u691c\u51fa\u3057\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h2>\u753b\u50cf\u3092\u9078\u629e\u3059\u308b\u90e8\u5206<\/h2>\n<p>\u3067\u306f\u3001\u6b21\u306b\u8868\u793a\u3055\u308c\u305f\u9854\u306e\u4e2d\u304b\u3089\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b\u9854\u3092\u9078\u629e\u3059\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001<code>data<\/code>\u306e\u4e2d\u306b<code>checkedIndexes<\/code>\u3068\u3044\u3046\u30c1\u30a7\u30c3\u30af\u3055\u308c\u305f\u753b\u50cf\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<pre>data: {\r\n    \/\/ \u7701\u7565\r\n    <strong>checkedIndexes: []<\/strong>\r\n},<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u5909\u6570\u3092\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306b\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;input type=\"checkbox\" :value=\"index\" <strong>v-model=\"checkedIndexes\"<\/strong>&gt;<\/pre>\n<p>\u3053\u308c\u3067\u3001\u30c1\u30a7\u30c3\u30af\u3055\u308c\u305f\u753b\u50cf\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067<code>checkedIndexes<\/code>\u306b\u53cd\u6620\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b<\/h2>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b<strong> &#8220;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b&#8221;<\/strong> \u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642\u306e\u30b3\u30fc\u30c9\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3068\u304d\u306b<code>pixelate()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;button\r\n    type=\"button\"\r\n    class=\"btn btn-danger btn-sm\"\r\n    style=\"position:absolute;right:15px;bottom:15px;\"\r\n    :disabled=\"!hasFace\"\r\n    <strong>@click=\"pixelate()\"<\/strong>&gt;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b&lt;\/button&gt;<\/pre>\n<p>\u4e2d\u8eab\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>pixelate() {\r\n    const target = __dirname +'\/python\/pixelate_face.py'\r\n    const command = '\/usr\/bin\/python \"'+ target +'\"'\r\n        +' -i \"'+ this.imagePath +'\"'\r\n        <strong>+\" -p '\"+ JSON.stringify(this.checkedFaces) +\"'\"<\/strong>\r\n    const process = spawn('\/bin\/sh', ['-c', command])\r\n    process.stdout.on('data', (data) =&gt; {\r\n        let message = '';\r\n        <strong>let dataString = data.toString().replace(\"\\n\", '')<\/strong>\r\n        if(dataString == 'pixelated') {\r\n            message = '\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\uff01'\r\n        } else {\r\n            message = '\u4e88\u671f\u305b\u306c\u30a8\u30e9\u30fc\u306b\u3088\u308a\u5931\u6557\u3057\u307e\u3057\u305f\u30fb\u30fb\u30fb'\r\n        }\r\n        this.checkedIndexes = []\r\n        alert(message);\r\n    });\r\n}<\/pre>\n<p>\u57fa\u672c\u7684\u306bpython\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u304c\u3001\u3055\u3063\u304d\u3068\u9055\u3046\u306e\u306f\u30d1\u30e9\u30e1\u30fc\u30bf<code>p<\/code>\u3092JSON\u3067\u6307\u5b9a\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3001\u305d\u3057\u3066\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u305f\u6642\u306b\u53d6\u5f97\u3059\u308b<code>data<\/code>\u306b\u306f\u6539\u884c\u30b3\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u3053\u308c\u3092\u9664\u53bb\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u540c\u3058\u304f\u6b21\u306e\u753b\u50cf\u3092\u4f7f\u3063\u3066\u6700\u7d42\u30c6\u30b9\u30c8\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2257\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/faces.jpg\" alt=\"\" width=\"457\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/faces.jpg 457w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/faces-214x300.jpg 214w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<p>\u307e\u305a\u9854\u304c\u5165\u3063\u305f\u753b\u50cf\u3092\u9078\u629e\u3059\u308b\u3068\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3067\u304d\u308b\u9854\u304c\u691c\u51fa\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2258\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-21-11-15.png\" alt=\"\" width=\"402\" height=\"432\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-21-11-15.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-21-11-15-279x300.png 279w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p>\u3067\u306f\u3001\u304a\u5b50\u3055\u3093\u3060\u3051\u6b8b\u3057\u3066\u5f8c\u306f\u5168\u54e1\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2262\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-23-42-47.png\" alt=\"\" width=\"402\" height=\"432\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-23-42-47.png 402w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-10-23-42-47-279x300.png 279w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/p>\n<p><strong>&#8220;\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3059\u308b&#8221;<\/strong> \u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u306f\u3069\u3046\u306a\u3063\u305f\u3067\u3057\u3087\u3046\u304b\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2263\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pixelated-faces.jpg\" alt=\"\" width=\"457\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pixelated-faces.jpg 457w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pixelated-faces-214x300.jpg 214w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<p>\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u6210\u529f\u3067\u3059\uff01<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u771f\u3093\u4e2d\u306e\u304a\u6bcd\u3055\u3093\u3060\u3051\u6b8b\u3057\u3066\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2264\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pixelated-faces-1.jpg\" alt=\"\" width=\"457\" height=\"640\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pixelated-faces-1.jpg 457w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/pixelated-faces-1-214x300.jpg 214w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<p>\u3053\u3061\u3089\u3082\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\uff01<br \/>\n\u3053\u306e\u30a2\u30d7\u30ea\u3092\u4f7f\u3048\u3070\u7c21\u5358\u306b\u30e2\u30b6\u30a4\u30af\u51e6\u7406\u3067\u304d\u307e\u3059\u306d\u3002<\/p>\n<h1>\u6559\u6750\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001<code>npm<\/code>\u3084<code>pip<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3054\u81ea\u8eab\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=2267&amp;tmstv=1777573240\" rel=\"nofollow\" id=\"download-link-2267\" data-redirect=\"false\" >\n\tElectron + Python \u3067\u9854\u306b\u30e2\u30b6\u30a4\u30af<\/a>\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u3068\u3053\u308dElectron\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u9762\u767d\u304f\u306a\u3063\u3066\u304d\u3066\u500b\u4eba\u7684\u306b\u3082\u3044\u308d\u3044\u308d\u3068\u958b\u767a\u3059\u308b\u610f\u6b32\u304c\u6e67\u3044\u3066\u304d\u3066\u3044\u307e\u3059\u3002 \u305d\u3057\u3066\u3001\u305d\u3093\u306a\u4e2d\u3067\u81ea\u7136\u3068\u8a66\u3057\u305f\u3044\u3053\u3068\u304c\u982d &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2246\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Electron + Python \u3067\u9078\u3093\u3060\u9854\u306b\u30e2\u30b6\u30a4\u30af\u3092\u304b\u3051\u308b\u30a2\u30d7\u30ea\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2271,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49,120,39,12,97],"tags":[111,103],"class_list":["post-2246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electron","category-opencv","category-python","category-vue-js","category-97","tag-111","tag-103"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2246"}],"version-history":[{"count":9,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2246\/revisions"}],"predecessor-version":[{"id":6244,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2246\/revisions\/6244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2271"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}