未验证 提交 22208bf9 编写于 作者: L lzzyzlbb 提交者: GitHub

add default output for stylegan and fom (#501)

上级 233d05d9
......@@ -226,6 +226,8 @@ class FirstOrderModel(BaseModel):
driving2 = {'value': value2, 'jacobian': j2}
driving3 = {'value': value, 'jacobian': j}
if output_dir is None:
output_dir = 'inference_model'
outpath = os.path.join(output_dir, "fom_dy2st")
if not os.path.exists(outpath):
os.makedirs(outpath)
......
......@@ -314,6 +314,8 @@ class StyleGAN2Model(BaseModel):
infer_generator.set_generator(self.nets['gen'])
style = paddle.rand(shape=inputs_size[0], dtype='float32')
truncation = paddle.rand(shape=inputs_size[1], dtype='float32')
if output_dir is None:
output_dir = 'inference_model'
paddle.jit.save(infer_generator,
os.path.join(output_dir, "stylegan2model_gen"),
input_spec=[style, truncation])
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册