顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== AI 修照片工具 ====== * 執行環境 : * VM : 8vCPU / 2GRAM / 32GSSD / No GPU * OS : Ubuntu 20.04.5 * 已安裝套件版本 * git version 2.25.1 * Python 3.8.10 ===== CodeFormer ===== * 網址 - https://github.com/sczhou/CodeFormer * 安裝 Pytorch >= 1.7.1 , Ref - https://varhowto.com/install-pytorch-ubuntu-20-04/ <cli> sudo apt install python3-pip python-is-python3 sudo pip3 install torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html </cli> * 下載 CodeFormer 程式碼<cli> git clone https://github.com/sczhou/CodeFormer </cli> * 安裝相關 python 套件<cli> cd CodeFormer sudo pip3 install -r requirements.txt sudo python basicsr/setup.py develop </cli> * 下載已訓練的模型 <cli> sudo apt install ffmpeg libsm6 libxext6 sudo python scripts/download_pretrained_models.py facelib sudo python scripts/download_pretrained_models.py CodeFormer </cli> * 進行照片修復測試 - 將 /home/jonathan/ai_photos 掛載到 NAS 共享路徑 work_dir/AI_Photos - 將 /home/jonathan/CodeFormer/results 掛載到 NAS 共享路徑 work_dir/AI_Photos/results - 將需要修復的照片放入 /home/jonathan/ai_photos/inputs/old_pics 內 - 執行修復指令 <cli> sudo python inference_codeformer.py -w 0.5 --input_path /home/jonathan/ai_photos/inputs/old_pics </cli> - 執行完成後就會在 results\old_pics_0.5\final_results 內看到修復的照片檔案 {{tag>AI 照片修復}} tech/ai-photos.txt 上一次變更: 2023/01/14 21:05由 jonathan