AI與生活應用

AI多人換臉教學

務必先閱讀以下資訊

Deepfake(深偽),是深度學習(deep learning)與偽造(fake)的一種組合,主要意指應用人工智慧深度學習的技術,合成某個(不一定存在的)人的圖像或影片、甚至聲音。 (非指合成成人影片,我們譴責這樣誤用AI的人新聞)

STEP 1:

檔案下載

下載Refacer_colab,ipynb,上傳到自己的colab裡。

Google Colab 歡迎使用 Colaboratory - Colaboratory (google.com)   

男女主角換臉前

換臉後(挖屋...年輕的五百)

學生用範例檔案

課堂作業上傳區(22023/10/30)

先建立自己名字的資料夾

https://drive.google.com/drive/folders/1oosHa-_YlacLqKMs1sN75BkSwEaiIYjw?usp=drive_link 

需要其他的工具軟體:

螢幕錄影(ApowerREC)、影片截圖、Google colab

AI換臉服務教學 https://www.youtube.com/watch?v=VQtrF62tuEE 

多人換臉 Refacer Colab 使用教學 + 詳細步驟

 https://www.youtube.com/watch?v=_fLsVoMfJiQ 

Refacer安裝於Windows的教學(強烈建議安裝在有GPU的顯卡)

以下是針對有GPU的電腦(請事先確認您的nvidia顯卡有沒有支援h264,否則也是無法work!!!!)

本機端部署Refacer,可以安裝Anaconda,create一個環境

(Refacer has been tested and is known to work with Python 3.10.9, but it is likely to work with other Python versions as well) 

pip install -r requirements.txt

pip install -r requirements-GPU.txt

pip install -r requirements-COREML.txt

有關"Could not build wheels for insightface, which is required to install pyproject.toml-based projects"的錯誤訊息,可以參考 https://stackoverflow.com/questions/76739044/how-to-fix-this-issue-error-failed-building-wheel-for-insightface 做解決



安裝FFMPEG(參考教學 https://vocus.cc/article/64701a2cfd897800014daed0 )


以下為GPU版本的錯誤訊息

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

gensim 4.3.0 requires FuzzyTM>=0.4.0, which is not installed.

numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.3 which is incompatible.


需要在文字檔中更新找到適合的版本

Anaconda 環境安裝設定參考文件

VALLE本機部署

教學影片 https://www.youtube.com/watch?v=D8tFRIF92WY 

Github https://github.com/Plachtaa/VALL-E-X/blob/master/README-ZH.md

如果需要制作prompt,需要安装 ffmpeg 并将其所在文件夹加入到环境变量PATH中 (這個參考Refacer部屬裡FFMEPG的教學)

執行 python -X utf8 launch-ui.py

會跳出一個網頁視窗

=================================

如果要使用GPU,必須要下指令 

移除 pip uninstall torch torchvision torchaudio

安裝 pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu

118 這裡是安裝cudua 11.8版本(支援11.7以上)

執行 python -X utf8 launch-ui.py


====================

中文的話要繁中轉簡中唷