@byxiaoxie2 年前
03/6
21:38
系统环境:Windows 10 1909 显卡:GTX 1060 CPU:I7 8700k (测试GPU算法修复动漫图片 5s 跑完4X修复)
CUDA 下载并安装:
Docs文档(用于查询对应版本):https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
CUDA下载:https://developer.nvidia.com/cuda-toolkit-archive
Anaconda 下载安装:
官方地址:https://www.anaconda.com/
安装完成后需配置环境变量
例子 Path:D:\Anaconda3\condabin
Anaconda 创建虚拟环境:
conda create -n 名称 jupyter notebook cudnn
预先安装第三方库 jupyter notebook cudnn
cudnn 用于深度神经网络的 GPU 加速库
jupyter notebook 交互式编辑器
例子 conda create -n gary jupyter notebook cudnn
切换到新的虚拟环境
activate 名称
例子 activate gary
切换后可用 [conda env list] 查看是否切换成功
报错信息:
Collecting package metadata (current_repodata.json): failed
CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.
Exception: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
解决方法:
配置环境变量 Path: D:\Anaconda3\Library\bin
开始部署 Real-ESRGAN :
Github:https://github.com/xinntao/Real-ESRGAN
1. 先安装PyTorch 地址:https://pytorch.org/get-started/locally/
2. 下载仓库代码 git clone https://github.com/xinntao/Real-ESRGAN.git
3. pip install -r requirements.txt
4. 下载已经训练好的模型
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P weights
5. 执行测试 -n 模型名称 -i 输入的目录或文件 --face_enhance 人脸修复(官方文档上提示是不建议修复动漫图片的)
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance
6. 即可输出测试的动漫图片高清修复