当前位置: 首页>>代码示例>>Python>>正文


Python cyclegan.cyclegan_generator_resnet方法代码示例

本文整理汇总了Python中nets.cyclegan.cyclegan_generator_resnet方法的典型用法代码示例。如果您正苦于以下问题:Python cyclegan.cyclegan_generator_resnet方法的具体用法?Python cyclegan.cyclegan_generator_resnet怎么用?Python cyclegan.cyclegan_generator_resnet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nets.cyclegan的用法示例。


在下文中一共展示了cyclegan.cyclegan_generator_resnet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _select_network

# 需要导入模块: from nets import cyclegan [as 别名]
# 或者: from nets.cyclegan import cyclegan_generator_resnet [as 别名]
def _select_network(self):
    get_noise_shape = None
    if FLAGS.generator_network == 'pggan':
      generator_network_fn = pggan.generator
      discriminator_network_fn = pggan.discriminator
      get_noise_shape = pggan.get_noise_shape
    elif FLAGS.generator_network == 'cyclegan':
      generator_network_fn = cyclegan.cyclegan_generator_resnet
      discriminator_network_fn = cyclegan_dis.cyclegan_discriminator_resnet
    else:
      raise NotImplementedError('Generator network %s is not implemented.', FLAGS.generator_network)
    return {'generator_network_fn': generator_network_fn,
            'discriminator_network_fn': discriminator_network_fn,
            'get_noise_shape': get_noise_shape, }

  ####################
  # Define the model #
  #################### 
开发者ID:jerryli27,项目名称:TwinGAN,代码行数:20,代码来源:image_generation.py

示例2: _input_and_output_same_shape_helper

# 需要导入模块: from nets import cyclegan [as 别名]
# 或者: from nets.cyclegan import cyclegan_generator_resnet [as 别名]
def _input_and_output_same_shape_helper(self, kernel_size):
    img_batch = tf.placeholder(tf.float32, shape=[None, 32, 32, 3])
    output_img_batch, _ = cyclegan.cyclegan_generator_resnet(
        img_batch, kernel_size=kernel_size)

    self.assertAllEqual(img_batch.shape.as_list(),
                        output_img_batch.shape.as_list()) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:9,代码来源:cyclegan_test.py

示例3: test_generator_inference

# 需要导入模块: from nets import cyclegan [as 别名]
# 或者: from nets.cyclegan import cyclegan_generator_resnet [as 别名]
def test_generator_inference(self):
    """Check one inference step."""
    img_batch = tf.zeros([2, 32, 32, 3])
    model_output, _ = cyclegan.cyclegan_generator_resnet(img_batch)
    with self.test_session() as sess:
      sess.run(tf.global_variables_initializer())
      sess.run(model_output) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:9,代码来源:cyclegan_test.py

示例4: _test_generator_graph_helper

# 需要导入模块: from nets import cyclegan [as 别名]
# 或者: from nets.cyclegan import cyclegan_generator_resnet [as 别名]
def _test_generator_graph_helper(self, shape):
    """Check that generator can take small and non-square inputs."""
    output_imgs, _ = cyclegan.cyclegan_generator_resnet(tf.ones(shape))
    self.assertAllEqual(shape, output_imgs.shape.as_list()) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:6,代码来源:cyclegan_test.py

示例5: test_generator_unknown_batch_dim

# 需要导入模块: from nets import cyclegan [as 别名]
# 或者: from nets.cyclegan import cyclegan_generator_resnet [as 别名]
def test_generator_unknown_batch_dim(self):
    """Check that generator can take unknown batch dimension inputs."""
    img = tf.placeholder(tf.float32, shape=[None, 32, None, 3])
    output_imgs, _ = cyclegan.cyclegan_generator_resnet(img)

    self.assertAllEqual([None, 32, None, 3], output_imgs.shape.as_list()) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:8,代码来源:cyclegan_test.py

示例6: _error_if_height_not_multiple_of_four_helper

# 需要导入模块: from nets import cyclegan [as 别名]
# 或者: from nets.cyclegan import cyclegan_generator_resnet [as 别名]
def _error_if_height_not_multiple_of_four_helper(self, height):
    self.assertRaisesRegexp(
        ValueError,
        'The input height must be a multiple of 4.',
        cyclegan.cyclegan_generator_resnet,
        tf.placeholder(tf.float32, shape=[None, height, 32, 3])) 
开发者ID:leimao,项目名称:DeepLab_v3,代码行数:8,代码来源:cyclegan_test.py


注:本文中的nets.cyclegan.cyclegan_generator_resnet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。