1 Star 0 Fork 0

范钟 / deep-photo-styletransfer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gen_all.py 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
Marco Forte 提交于 2017-03-31 19:28 . python3 print
import os
import math
# number of GPUs available
numGpus = 8
# number of image pairs to process
numImgs = 60
N = int(math.ceil(float(numImgs)/numGpus))
for j in range(1, numGpus + 1):
cmd = ''
for i in range(1, N + 1):
idx = (i-1) * numGpus + j
if idx <= numImgs:
print('working on image pair index = ' + str(idx))
part1_cmd = ' th neuralstyle_seg.lua -content_image examples/input/in'+str(idx)+'.png -style_image examples/style/tar'+str(idx)+'.png -content_seg examples/segmentation/in'+str(idx)+'.png -style_seg examples/segmentation/tar'+str(idx)+'.png -index '+str(idx)+' -num_iterations 1000 -save_iter 100 -print_iter 1 -gpu '+str(j-1)+' -serial examples/tmp_results &&'
part2_cmd = ' th deepmatting_seg.lua -content_image examples/input/in'+str(idx)+'.png -style_image examples/style/tar'+str(idx)+'.png -init_image examples/tmp_results/out'+str(idx)+'\_t_1000.png -content_seg examples/segmentation/in'+str(idx)+'.png -style_seg examples/segmentation/tar'+str(idx)+'.png -index '+str(idx)+' -num_iterations 1000 -save_iter 100 -print_iter 1 -gpu '+str(j-1)+' -serial examples/final_results -f_radius 15 -f_edge 0.01 &&'
cmd = cmd + part1_cmd + part2_cmd
cmd = cmd[1:len(cmd)-1]
print(cmd)
os.system(cmd)
1
https://gitee.com/zfan_codes/deep-photo-styletransfer.git
git@gitee.com:zfan_codes/deep-photo-styletransfer.git
zfan_codes
deep-photo-styletransfer
deep-photo-styletransfer
master

搜索帮助