提交 53a805f5 编写于 作者: X xiaoting 提交者: lujun

Refine readme for cycle_gan (#2420)

1.Modify the checkpoint save path
2. Modifiy the img save paht
3. Synchronous modification for Readme
4. update generated result img
上级 cc473ce7
......@@ -88,6 +88,7 @@ todo:loss曲线
```
env CUDA_VISIBLE_DEVICES=0 python test.py --epoch=200
```
生成结果在 `output_0/eval`
### 预测
......@@ -98,7 +99,7 @@ env CUDA_VISIBLE_DEVICES=0 python test.py --epoch=200
```
env CUDA_VISIBLE_DEVICES=0 python infer.py \
--init_model="./G/199" --input="./image/testA/123_A.jpg" \
--init_model="./output_0/checkpoints/199" --input="./image/testA/123_A.jpg" \
--input_style=A
```
......@@ -106,9 +107,10 @@ env CUDA_VISIBLE_DEVICES=0 python infer.py \
```
env CUDA_VISIBLE_DEVICES=0 python infer.py \
--init_model="./G/199" --input="./image/testB/78_B.jpg" \
--init_model="./output_0/checkpoints/199" --input="./image/testB/78_B.jpg" \
--input_style=B
```
生成结果在 `output_0/single`
训练180轮的模型预测效果如fakeA和fakeB所示:
......
dygraph/cycle_gan/image/A2B.png

175.5 KB | W: | H:

dygraph/cycle_gan/image/A2B.png

154.5 KB | W: | H:

dygraph/cycle_gan/image/A2B.png
dygraph/cycle_gan/image/A2B.png
dygraph/cycle_gan/image/A2B.png
dygraph/cycle_gan/image/A2B.png
  • 2-up
  • Swipe
  • Onion skin
dygraph/cycle_gan/image/B2A.png

161.3 KB | W: | H:

dygraph/cycle_gan/image/B2A.png

143.2 KB | W: | H:

dygraph/cycle_gan/image/B2A.png
dygraph/cycle_gan/image/B2A.png
dygraph/cycle_gan/image/B2A.png
dygraph/cycle_gan/image/B2A.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -25,15 +25,15 @@ add_arg = functools.partial(add_arguments, argparser=parser)
# yapf: disable
add_arg('input', str, "123_A.jpg", "input image")
add_arg('input', str, "./image/testA/123_A.jpg", "input image")
add_arg('output', str, "./output_0", "The directory the model and the test result to be saved to.")
add_arg('init_model', str, './G/150', "The init model file of directory.")
add_arg('init_model', str, './output_0/checkpoints/0', "The init model file of directory.")
add_arg('input_style', str, "A", "A or B")
def infer():
with fluid.dygraph.guard():
data_shape = [-1,3,256,256]
out_path = args.output + "/single" + "/" + str(args.input)
out_path = args.output + "/single"
if not os.path.exists(out_path):
os.makedirs(out_path)
cycle_gan = Cycle_Gan("cycle_gan")
......
......@@ -25,7 +25,7 @@ add_arg = functools.partial(add_arguments, argparser=parser)
add_arg('batch_size', int, 1, "Minibatch size.")
add_arg('epoch', int, None, "The number of weights to be testes.")
add_arg('output', str, "./output_0", "The directory the model and the test result to be saved to.")
add_arg('init_model', str, './G/', "The init model file of directory.")
add_arg('init_model', str, './output_0/checkpoints/', "The init model file of directory.")
def test():
with fluid.dygraph.guard():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册