DragGAN分析环境本地部署

今天给大家复现DragGAN实现图片拖拉拽编辑,效果如下图,如有疑问,欢迎联系本人!!!!
源代码地址:https://github.com/XingangPan/DragGAN
1.环境配置


####安装miniconda环境,进行深度学习环境管理
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

####隔离环境
conda config --set auto_activate_base false
conda env list

####安装环境,至少是3.8以上,test是DragGAN环境名称
conda create --name test python=3.9  

###激活环境test,进行DragGAN环境配置
conda activate test

2.git安装及克隆代码到本地


#####git安装,需要添加git环境变量
winget install --id Git.Git -e --source winget       
#####克隆代码到本地
git clone https://github.com/XingangPan/DragGAN.git  

3.清华源配置


####尝试无GPU安装环境,添加安装源加速安装
###添加清华镜像源
cd DragGAN
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  1. DragGAN环境安装

####安装DragGAN环境
pip install -r requirements.txt

####下载预训练模型,模型加载会使用
python scripts/download_model.py

####使用
python visualizer_drag_gradio.py

5.代码调试与测试


报错问题:'dict' object has no attribute 'img_resolution'
初步解决方案:pip install gradio==3.36.1
问题解决参考:!python /content/DragGAN/visualizer_drag_gradio.py Problem · Issue #409 · XingangPan/DragGAN (github.com)

6.其他需求

有偿咨询和需求解决:如需要进行GPU环境配置,需要训练自己的图片,请留言或者直接联系本人:kriswcyYQ。

  • 7
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值