當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。