比赛记录(一)
一、AI换装:
1:模型安装与调试
Viton -Gan
项目地址:
https://github.com/shionhonda/viton-gan
clone好以后,目录中只有文件,没有文件夹,缺少:
1:编译环境,torch -gpu版本地址:链接:https://pan.baidu.com/s/1d6ThY0AlhDF-cJQenL8vLw
提取码:j784 通过pip install XXXXXXX.whl安装 (python3.7, 64位,cuda为10.2)
通过pip或者conda安装:https://pytorch.org/见此
如图:
其余的基本上就是个个可视化的,直接安装就行。
2:需要下载data数据集:包含:
见此:https://pan.baidu.com/share/init?surl=bdB3mdWBAD8-5uYoa3Kp4Q 提取码:8aum
脚本介绍,以及后续运行顺序
说明:
2:代码运行
运行train_gmm
如果运行报错:
Traceback (most recent call last):
File "train.py", line 191, in <module>
main()
File "train.py", line 176, in main
train_gmm(opt, train_loader, model, board)
File "train.py", line 58, in train_gmm
inputs = train_loader.next_batch()
File "/vton/cinastanbean-cp-vton/cp_dataset.py", line 166, in next_batch
...
tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
RuntimeError: output with shape [1, 256, 192] doesn't match the broadcast shape [3, 256, 192]
self.transform = transforms.Compose([ \
transforms.ToTensor(), \
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])
self.transform = transforms.Compose([ \
transforms.ToTensor(), \
transforms.Normalize((0.5,), (0.5,))])
测试时,不用改epoch为100,测试用1-10就行
会在:
里面的GMM打开:
3:运行run_gmm
要是报runtime错,请修改batchsize,降低到6左右
要是报一个out of memenoy 请降低n_worker 为0-4左右
然后运行结束后会在data /train 和test 或者val中各添加两个拟合,与掩码图片:
4,然后就运行train _tom
需要一个VGG19模型,请点击:https://blog.csdn.net/Da_Yuan8421/article/details/88836970
写错了。应该是torch 下面的checkpoints里面
运行train_tom这个是生成最后的拟合模型,根据你的epoch数决定
会在根目录的result里面的TOM下生成模型pth
(这个我有训练好65个epoch的)
然后就最后run_tom:
结果如图:(只训练了几个epoch)
目标效果: