pix2pix代码的一些深入探究

2019-06-07  本文已影响0人  幽并游侠儿_1425

希望解决的问题:

提升resolution.

可以用切成patches的方法

从网站上我找了training和test的tip,里面写有如下的句子,比较有用:

Training/Testing with high res images

CycleGAN is quite memory-intensive as four networks (two generators and two discriminators) need to be loaded on one GPU, so a large image cannot be entirely loaded. In this case, we recommend training with cropped images. For example, to generate 1024px results, you can train with --preprocess scale_width_and_crop --load_size 1024 --crop_size 360, and test with --preprocess scale_width --load_size 1024. This way makes sure the training and test will be at the same scale. At test time, you can afford higher resolution because you don’t need to load all networks.

目前我遇到的问题是:

input图片是1024*1024,但是输出的图片却是256*256,我觉得可能的原因是代码里自动把我的数据给crop了。

于是尝试新的test命令行如下:

python test.py --dataroot datasets/cells/AB --name cells_pix2pix --model pix2pix --direction BtoA --preprocess scale_width --load_size 1024

尝试新的train命令行应该如下:

python train.py --dataroot ./datasets/cells/AB --name cells_pix2pix --model pix2pix --direction BtoA --preprocess scale_width_and_crop --load_size 1024 --crop_size 256

结果存储的位置:主文件夹下的result文件夹

结果是边缘很糊。我觉得可以尝试解决边缘的问题:试图改变input_data里面的groundtruth。

提取边缘,

然后用“python datasets/combine_A_and_B.py --fold_A datasets/cells/A --fold_B datasets/cells/B --fold_AB datasets/cells/AB”重新整合边缘。

上一篇 下一篇

猜你喜欢

热点阅读