{"id":8879,"date":"2020-02-03T09:54:05","date_gmt":"2020-02-03T00:54:05","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=8879"},"modified":"2020-05-28T09:44:01","modified_gmt":"2020-05-28T00:44:01","slug":"%ec%bc%80%eb%9d%bc%ec%8a%a4keras%ec%9d%98-get_file-%ed%95%a8%ec%88%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=8879","title":{"rendered":"\ucf00\ub77c\uc2a4(Keras)\uc758 get_file \ud568\uc218"},"content":{"rendered":"<p>\uc2e0\uacbd\ub9dd \ud559\uc2b5\uc744 \uc704\ud55c \ub370\uc774\ud130 \uc900\ube44\ub97c \uc704\ud574, \uc778\ud130\ub137 \uc0c1\uc758 \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc544 \uc555\ucd95\uc744 \ud480 \uacbd\uc6b0\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub54c \ub0b4\uac00 \uc6d0\ud558\ub294 \ub85c\uceec \uacbd\ub85c\uc5d0 \ub2e4\uc6b4\ub85c\ub4dc\ub97c \ubc1b\uace0, \uc6d0\ud558\ub294 \uc11c\ube0c \ub514\ub809\ud1a0\ub9ac\uc5d0 \uc555\ucd95\uc744 \ud480\uae30 \uc704\ud574 \ub2e4\uc74c\uc758 \ucf54\ub4dc\uac00 \uc0ac\uc6a9\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport tensorflow as tf\r\n\r\npath = 'D:\/GeoAI\/20200203'\r\ntf.keras.utils.get_file(path + '\/image.zip', 'http:\/\/where.net\/data.zip', extract=True, cache_subdir='data', cache_dir=path)\r\n<\/pre>\n<p>\uacb0\uacfc\uc801\uc73c\ub85c \uc778\ud130\ub137 \uc0c1\uc5d0 \uc874\uc7ac\ud558\ub294 http:\/\/where.net\/data.zip\uc744 D:\/GeoAI\/20200203 \ub514\ub809\ud1a0\ub9ac\uc5d0 image.zip \ud30c\uc77c\uba85\uc73c\ub85c \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uace0, \uc555\ucd95\uc740 D:\/GeoAI\/20200203\/data\uc5d0 \ud480\uac8c \ub429\ub2c8\ub2e4.<\/p>\n<p>\ucd94\uac00\uc801\uc73c\ub85c \uc544\ub798\uc758 \ucf54\ub4dc\ub294 \uc555\ucd95\uc774 \ud480\ub9b0 \ud30c\uc77c\uba85 \ub9ac\uc2a4\ud2b8\ub97c \uc5bb\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4. <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport pathlib\r\nfile_path = pathlib.Path(path + '\/data\/images')\r\n\r\nfile_paths = list(file_path.glob('*\/*'))\r\nprint(file_paths[:10])\r\n<\/pre>\n<p>\uc774\ub807\uac8c \uc5bb\uc740 \ud30c\uc77c\ub4e4\uc758 \uacbd\ub85c\ub97c \ud1b5\ud574, \ub9cc\uc57d \ud574\ub2f9 \ud30c\uc77c\uc774 \uc774\ubbf8\uc9c0 \ud615\uc2dd\uc774\ub77c\uba74 \uc2e4\uc81c \ud654\uba74\uc0c1\uc5d0 \ud45c\uc2dc\ud574 \ud655\uc778\ud560 \uc218 \uc788\ub294\ub370, \ud574\ub2f9 \ucf54\ub4dc\ub294 \uc544\ub798\uc640 \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\">\r\nimport matplotlib.pyplot as plt\r\nimport os\r\n\r\nplt.figure(figsize=(12,12))\r\nfor i in range(9):\r\n    plt.subplot(3,3,i+1)\r\n    plt.imshow(plt.imread(file_paths[i]))\r\n    plt.title(os.path.basename(file_paths[i]))\r\n    plt.axis('off')\r\nplt.show()\r\n<\/pre>\n<p>\uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2020\/02\/getfilesandview.jpg\" alt=\"\" width=\"1920\" height=\"1050\" class=\"aligncenter size-full wp-image-8880\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc2e0\uacbd\ub9dd \ud559\uc2b5\uc744 \uc704\ud55c \ub370\uc774\ud130 \uc900\ube44\ub97c \uc704\ud574, \uc778\ud130\ub137 \uc0c1\uc758 \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc \ubc1b\uc544 \uc555\ucd95\uc744 \ud480 \uacbd\uc6b0\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub54c \ub0b4\uac00 \uc6d0\ud558\ub294 \ub85c\uceec \uacbd\ub85c\uc5d0 \ub2e4\uc6b4\ub85c\ub4dc\ub97c \ubc1b\uace0, \uc6d0\ud558\ub294 \uc11c\ube0c \ub514\ub809\ud1a0\ub9ac\uc5d0 \uc555\ucd95\uc744 \ud480\uae30 \uc704\ud574 \ub2e4\uc74c\uc758 \ucf54\ub4dc\uac00 \uc0ac\uc6a9\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. import tensorflow as tf path = &#8216;D:\/GeoAI\/20200203&#8217; tf.keras.utils.get_file(path + &#8216;\/image.zip&#8217;, &#8216;http:\/\/where.net\/data.zip&#8217;, extract=True, cache_subdir=&#8217;data&#8217;, cache_dir=path) \uacb0\uacfc\uc801\uc73c\ub85c \uc778\ud130\ub137 \uc0c1\uc5d0 \uc874\uc7ac\ud558\ub294 http:\/\/where.net\/data.zip\uc744 D:\/GeoAI\/20200203 \ub514\ub809\ud1a0\ub9ac\uc5d0 image.zip &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=8879\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;\ucf00\ub77c\uc2a4(Keras)\uc758 get_file \ud568\uc218&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133,132,1],"tags":[],"class_list":["post-8879","post","type-post","status-publish","format-standard","hentry","category-tensorflow","category-deep-machine-learning","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8879"}],"version-history":[{"count":2,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8879\/revisions"}],"predecessor-version":[{"id":9339,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/8879\/revisions\/9339"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8879"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}