<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 游俊彥 | Jun-Yan,You on Medium]]></title>
        <description><![CDATA[Stories by 游俊彥 | Jun-Yan,You on Medium]]></description>
        <link>https://medium.com/@toshihiko?source=rss-31ce25ea49c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sLpLCY6urYZJQivjYmR4jQ.jpeg</url>
            <title>Stories by 游俊彥 | Jun-Yan,You on Medium</title>
            <link>https://medium.com/@toshihiko?source=rss-31ce25ea49c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 17:23:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@toshihiko/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Google Cloud Platform | 利用GCP的VM來算圖(以FakeApp為例)]]></title>
            <link>https://medium.com/@toshihiko/google-cloud-platform-%E5%88%A9%E7%94%A8gcp%E7%9A%84vm%E4%BE%86%E7%AE%97%E5%9C%96-%E4%BB%A5fakeapp%E7%82%BA%E4%BE%8B-8e8aff554c2c?source=rss-31ce25ea49c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e8aff554c2c</guid>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[游俊彥 | Jun-Yan,You]]></dc:creator>
            <pubDate>Wed, 14 Feb 2018 17:50:43 GMT</pubDate>
            <atom:updated>2018-02-14T19:25:24.394Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HtV_Nxeu1POpiOmHwcv7fg.jpeg" /></figure><h4>GCP介紹</h4><p>最早的Google Cloud大概可以追朔到App Engine時代開始，當時Google以PaaS的概念提供使用者透過IDE開發工具或指令的方式部署開發的應用程式到Google App Engine平台之上，省掉開發者建置環境、管理環境與監控環境等等的難題，甚至可以簡單的提供全球化網站服務。</p><p>2014年開始，正式宣佈Google Cloud平台，開始以Google Datacenter各項建設提供給需要的使用者透過線上訂購，讓使用者以自我建置、管理、監控的方式來使用各項資源，建置自己的服務，並且提供給世界各地終端使用者使用。</p><p>更多介紹可以到這邊看：<a href="https://gcpug-tw.gitbooks.io/google-cloud-platform-in-practice/content/ren-shi-google-cloud.html">https://gcpug-tw.gitbooks.io/google-cloud-platform-in-practice/content/ren-shi-google-cloud.html</a></p><h4>前言</h4><p>相信很多人想要使用FakeApp卻沒有支援CUDA的顯示卡吧，沒關係！這次教你使用GCP的Compute Engine，建立一個雲端虛擬機來算圖，新開通的帳號都會免費獲得 $300 美元的試用額度(12個月)，不過要建立含有GPU的VM目前需要花一點錢XD，詳細的程序底下會介紹</p><h4>一、開通GCP服務並申請GPU配額</h4><p>1.利用Google帳號開通GCP服務(需要一張信用卡)<br><a href="https://cloud.google.com/?hl=zh-tw">https://cloud.google.com/?hl=zh-tw</a>，注意如果暫時沒要用不要開通，試用期間只有12個月</p><p>2.申請NVIDIA K80 GPUs配額<br>a.點左上角開啟清單，選擇IAM與管理員&gt;配額</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*EKJxHKRzTxN-Hfonl7uuhg.png" /></figure><p>b.打開&quot;指標&quot;清單，點選&quot;無&quot;，並搜尋NVIDIA，勾選&quot; NVIDIA K80 GPUs&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*XrRFaMxq5VkJVqa1LTeL9w.png" /></figure><p>c.將它勾選起來並點選上方的&quot;編輯配額&quot;<br>d.填寫好資料後按下一步，新增配額限制填寫&quot;當前數量的+1&quot;，說明寫說你要用來幹嘛(大量算圖之類的)<br>e.完成之後，你會收到一封e-mail，內容大概是Google要求你付款35美到你的帳戶裡，是用來確保你不是亂申請的，這35美會新增到餘額裡，之後可以使用，只是不知道能不能退款就是了</p><p>3.付35美金到你的GCP帳戶裡(需要可刷海外的卡)<br>a.點左上角開啟清單，選擇帳單&gt;付款總覽&gt;提前付款&gt;然後付35美金</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbuXUYpTn69WfGEgLdKrbw.png" /></figure><p>b.去回覆一下收到的email，Google會回信通知你說已收到錢，要2~3個工作天才會處理完成，完成後會再寄信通知說已增加配額，之後就可開始建立虛擬機囉</p><h4>二、建立虛擬機及建置環境</h4><p>1.建立虛擬機<br>a.點左上角開啟清單，Compute Engine&gt;建立執行個體，名稱隨意，區域選&quot;asia-east1-b&quot;，機器類型點選自訂，核心與記憶體看個人，基本上2核8GB就夠了，調越高越貴，重點是GPU選&quot;NVIDIA Tesla K80&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*tWvSamSauiteEy7UQyKG2w.png" /></figure><p>b.點選開機磁碟的變更，映像檔選擇&quot;Windows Server 2016&quot;，開機磁碟建議SSD 50GB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*4bZhYpZUbyvHRhAtzOUCcA.png" /></figure><p>c.勾選防火牆的，&quot;允許HTTP流量&quot;，然後就可以按建立了</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*7wQO-s8JgxnTdo-Ab4gOYg.png" /></figure><p>2.遠端至虛擬機，設定虛擬機環境<br>a.等待虛擬機建立完成後，打開&quot;遠端桌面協定&quot;的清單，點選&quot;下載RDP檔案&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*FUi71z_SM6GwSk0F71Hy1A.png" /></figure><p>b.再點選設定&quot;設定Windows密碼&quot;，會生成一組密碼，是登入虛擬機要用的<br>c.複製好密碼後，開啟剛下載好的RDP檔案，即可遠端至虛擬機囉<br>d.看不習慣英文的人，可至設定更改地區並下載中文語言包，然後也可更改使用者密碼，下次登入時就可用自己的密碼了</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*N66ytBO_ahvBhiiWh2GruA.png" /></figure><p>e.安裝顯示卡的驅動程式：<a href="http://www.nvidia.com.tw/Download/index.aspx?lang=tw">http://www.nvidia.com.tw/Download/index.aspx?lang=tw</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*8OMugzLsgOmieoU011uhsg.png" /></figure><p>3.建置FakeApp使用環境<br>詳細可至我的另一篇<a href="https://medium.com/@toshihiko/fakeapp-%E8%BC%95%E9%AC%86%E6%8A%8A%E5%BD%B1%E7%89%87%E6%8F%9B%E4%B8%BB%E8%A7%92-%E4%BB%A5%E5%AF%B6%E5%8D%9A%E5%A3%AB%E7%82%BA%E4%BE%8B-6477da678b4f">教學</a></p><p>這篇文是我使用GCP很久後才生出來的XD，當初建置時的重點都忘了～<br>如有哪部分出問題或教學錯誤可在下面回覆，我會盡快處理的～</p><p>此篇教學文是被寶博士<a href="https://medium.com/@daaab">https://medium.com/@daaab</a><br>灑幣而產出，價值500DSB<br> by Jun-Yan,You</p><p>如果覺得這篇文章不錯，請幫我多按幾次鼓掌哦～</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e8aff554c2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FakeApp | 輕鬆把影片換主角(以寶博士為例)]]></title>
            <link>https://medium.com/@toshihiko/fakeapp-%E8%BC%95%E9%AC%86%E6%8A%8A%E5%BD%B1%E7%89%87%E6%8F%9B%E4%B8%BB%E8%A7%92-%E4%BB%A5%E5%AF%B6%E5%8D%9A%E5%A3%AB%E7%82%BA%E4%BE%8B-6477da678b4f?source=rss-31ce25ea49c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6477da678b4f</guid>
            <category><![CDATA[fake]]></category>
            <category><![CDATA[face]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[cuda]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[游俊彥 | Jun-Yan,You]]></dc:creator>
            <pubDate>Thu, 01 Feb 2018 11:40:21 GMT</pubDate>
            <atom:updated>2018-02-14T17:51:08.407Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*8XLYtcqXIayGZjX9.jpg" /></figure><h4><strong><em>聲明</em></strong></h4><ol><li>本教學照片經過寶博士同意使用</li><li>以下教學請大家用研究的角度來觀看</li></ol><p>---------------------------------------------------------------------------------------------------</p><h4><strong>一、軟硬體需求</strong></h4><ol><li>你必須有一張支援CUDA的顯示卡<br>支援清單 : <a href="https://developer.nvidia.com/cuda-gpus">https://developer.nvidia.com/cuda-gpus</a></li><li>安裝CUDA 8.0 (一定要8.0)<br><a href="https://developer.nvidia.com/cuda-80-ga2-download-archive">https://developer.nvidia.com/cuda-80-ga2-download-archive</a></li><li>安裝Visual Studio 2015 (需要微軟帳戶)<br><a href="https://my.visualstudio.com/Downloads?q=visual%20studio%202015&amp;wt.mc_id=o~msft~vscom~older-downloads">https://my.visualstudio.com/Downloads?q=visual%20studio%202015&amp;wt.mc_id=o~msft~vscom~older-downloads</a></li><li>FakeApp (最好載1.1)<br><a href="https://www.reddit.com/r/fakeapp/comments/7q5o7o/latest_version_download/?st=jcdmagwk&amp;sh=9d4af47f">https://www.reddit.com/r/fakeapp/comments/7q5o7o/latest_version_download/?st=jcdmagwk&amp;sh=9d4af47f</a></li><li>FFmepg (拆跟合併序列圖用)<br><a href="https://ffmpeg.zeranoe.com/builds/">https://ffmpeg.zeranoe.com/builds/</a></li></ol><h4><strong>二、使用前準備</strong></h4><p>1. 照下面的清單開新資料夾<br> ┌fakes(父)<br> │─data_A<br> │─data_B<br> │─model</p><p>2. 開新資料夾取名叫&quot;Sequence&quot;並將 FFmpeg/bin/ffmpeg.exe 複製過去</p><p>3. 準備你影片主角的照片並放入data_B資料夾<br> a. 格式必須為png<br> b. 大小不能超過1200 * 700 (可用格式工廠之類的快速轉檔)<br> c. 最好有不同角度不同表情<br> d. 越多越好，個人覺得至少100張，合照最好把其他人的臉裁掉(我沒裁)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDNwSBOoOIQGBaMnKDEJuA.png" /></figure><p>4. 準備你想替換主角的影片<br> a. 與你的主角越像越好<br> b. 10~15秒即可，越長算越久<br> c. 解析度不超過720p<br> d. 確認影片的FPS (用AE看之類的，右鍵內容寫的不準)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*Qpfk6tSYgvs460824HVXiA.png" /></figure><p>5. 將影片拆成序列圖 (FFmpeg，用別的軟體拆也可以)<br> a. 到Sequence資料夾按住Shift + 滑鼠右鍵， 點選&quot;在此處開啟命令視窗&quot;<br> b. 複製指令並修改參數 ffmpeg -i [檔名].mp4 -vf fps=[FPS] &quot;out%d.png&quot;<br> c. 右鍵貼上至CMD並按Enter，完成後，資料夾就會出現序列圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*fHQPSI1Ytcqk5qQg3BJIOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*Oc5XhbJA4g3tsQ5P3xjx6w.png" /></figure><p>d. 將這些序列圖複製到data_A資料夾<br> e. 開&quot;NoFace&quot;新資料夾，將沒有清楚出現臉的圖片移動過去(臉不清楚也要)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*Rk_ZfeFT5j_QdaqxueemwQ.png" /></figure><p>6. 最後你的data_A要有主角的照片，格式為png並不超過1200 * 700<br> data_B要有被替換主角影片的序列圖，每張都有清楚的臉<br> NoFace有序列圖沒臉的圖片跟不清楚臉的圖片</p><h4>三、開始使用FakeApp</h4><p>1. 開啟&quot;fakeapp.bat&quot;，你會看到Extract / Train / Covert三個選項</p><p>2. &quot;Extract&quot;，從你的圖片中抓取所有的臉<br> a. &quot;Paths&quot;的&quot;Data&quot;，貼上Data_A的路徑將&quot;\&quot;換成&quot;/&quot;，然後按下&quot;Start&quot;<br> b. 完成後你會看到Data_A裡多了&quot;alignments.json&quot;以及&quot; aligned&quot;資料夾，<br> 裡面都是被抓取出來的臉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*HrUM6NwRDvLDo0h26LN79g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*dMtDUMcq2okOXTyUFZoN3A.png" /></figure><p>c. 同a、b步驟，接下來對data_B也做一次，然後到data_B的aligned，把其他人的臉刪除(如果有的話)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*b27L9YiHmH2qH7T3TpTEUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*C7A5AndDhWSebLGqDSueeA.png" /></figure><p>3. &quot;Train&quot;，讓軟體開始比較兩張臉<br> a. 照以下規格貼上對應的路徑，記得&quot;\&quot;換成&quot;/&quot;，並按下&quot;Start&quot;<br> Model : 貼Model路徑<br> Data A : 貼data_A/aligned的路徑<br> Data B : 貼data_B/aligned的路徑<br> b. Training 至少要6小時以上，建議放著跑一個晚上，直到合成的臉清楚<br> c. 滿意之後可按下q停止(直接按叉叉也可以，我按q沒反應)，&quot;model&quot; 下就會多出 &quot;decoder_A.h5&quot;、&quot;decoder_B.h5&quot;、&quot;encoder.h5&quot;這三個檔案</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*xf5fyIJyeECf4jBCZ-W0lQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/0*0vfhJTEgnniieR58." /></figure><p>4. &quot; Convert&quot;，替換data_A的臉<br> a. &quot;Paths&quot;的&quot;Data&quot;貼上data_A的路徑，按&quot;Start&quot;<br> b. 完成後，data_A下會出現&quot;merged&quot;資料夾，裡面即是完成替換的序列圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*xGPncE1bJK6eGTKgoeeZNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*7PtREVEtbF-mSObY589Vyw.png" /></figure><h4>四、將完成替換的序列圖合併成影片</h4><p>1. 整理完成的序列圖<br> a. 把Sequence資料夾原來的序列圖刪除，或是你要留著<br> b. 完成的序列圖複製到Sequence資料夾<br> c. 把前面移走的不清楚臉圖片移動回來<br> d. 檢查一下數字正不正常，一定要連號</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*63DS8PgwOA5qt89xeY9V5Q.png" /></figure><p>2. 開始合併序列圖<br> a. 按住Shift + 滑鼠右鍵， 點選”在此處開啟命令視窗”<br> b. 修改指令參數貼上按Enter，ffmpeg -f image2 -i out%d.png -vcodec libx264 -crf [FPS] -pix_fmt yuv420p [檔名].mp4<br> c. 如果結果影片怪怪的，用AE合併會比較好<br> d. 大功告成</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*2Bm5bghjlxNTqXiwA4HfLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*63DS8PgwOA5qt89xeY9V5Q.png" /></figure><h4>五、備註</h4><ol><li>Data_A也可放入更多不同表情不同角度的照片來算</li><li>算出model之後，Data_A再放入同樣人不同影片的序列圖來合併也可行</li><li>舉例來說，我Data_A放入更多小勞勃道尼來算，會更精準，算好後，可以再把其他鋼鐵人的片段拿去Extract後Covert</li><li>經我實測，Train重開後會按照原進度繼續算，我有把Data_B沒刪掉的臉刪掉再開，一樣能繼續算</li><li>打完教學才發現好像也沒我標題打得那麼輕鬆?! XDDD</li></ol><p>我最後的成果XD<br><a href="https://youtu.be/VhHKYcfyen4">https://youtu.be/VhHKYcfyen4</a></p><p>此篇教學文是被寶博士<a href="https://medium.com/@daaab">https://medium.com/@daaab</a><br>灑幣而產出，價值500DSB<br> by Jun-Yan,You</p><p>如果覺得這篇文章不錯，請幫我多按幾次鼓掌哦～</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6477da678b4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>