Python util.get_generator_conditioning() Examples

The following are 10 code examples of util.get_generator_conditioning(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module util , or try the search function .
Example #1
Source File: eval.py    From yolo_v2 with Apache License 2.0 6 votes vote down vote up
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
  """Get generated images."""
  noise = tf.random_normal([num_images_generated, 64])
  # If conditional, generate class-specific images.
  if conditional_eval:
    conditioning = util.get_generator_conditioning(
        num_images_generated, num_classes)
    generator_inputs = (noise, conditioning)
    generator_fn = networks.conditional_generator
  else:
    generator_inputs = noise
    generator_fn = networks.generator
  # In order for variables to load, use the same variable scope as in the
  # train job.
  with tf.variable_scope('Generator'):
    data = generator_fn(generator_inputs)

  return data 
Example #2
Source File: eval.py    From Gun-Detector with Apache License 2.0 6 votes vote down vote up
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
  """Get generated images."""
  noise = tf.random_normal([num_images_generated, 64])
  # If conditional, generate class-specific images.
  if conditional_eval:
    conditioning = util.get_generator_conditioning(
        num_images_generated, num_classes)
    generator_inputs = (noise, conditioning)
    generator_fn = networks.conditional_generator
  else:
    generator_inputs = noise
    generator_fn = networks.generator
  # In order for variables to load, use the same variable scope as in the
  # train job.
  with tf.variable_scope('Generator'):
    data = generator_fn(generator_inputs, is_training=False)

  return data 
Example #3
Source File: eval.py    From object_detection_with_tensorflow with MIT License 6 votes vote down vote up
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
  """Get generated images."""
  noise = tf.random_normal([num_images_generated, 64])
  # If conditional, generate class-specific images.
  if conditional_eval:
    conditioning = util.get_generator_conditioning(
        num_images_generated, num_classes)
    generator_inputs = (noise, conditioning)
    generator_fn = networks.conditional_generator
  else:
    generator_inputs = noise
    generator_fn = networks.generator
  # In order for variables to load, use the same variable scope as in the
  # train job.
  with tf.variable_scope('Generator'):
    data = generator_fn(generator_inputs)

  return data 
Example #4
Source File: eval.py    From g-tensorflow-models with Apache License 2.0 6 votes vote down vote up
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
  """Get generated images."""
  noise = tf.random_normal([num_images_generated, 64])
  # If conditional, generate class-specific images.
  if conditional_eval:
    conditioning = util.get_generator_conditioning(
        num_images_generated, num_classes)
    generator_inputs = (noise, conditioning)
    generator_fn = networks.conditional_generator
  else:
    generator_inputs = noise
    generator_fn = networks.generator
  # In order for variables to load, use the same variable scope as in the
  # train job.
  with tf.variable_scope('Generator'):
    data = generator_fn(generator_inputs, is_training=False)

  return data 
Example #5
Source File: eval.py    From multilabel-image-classification-tensorflow with MIT License 6 votes vote down vote up
def _get_generated_data(num_images_generated, conditional_eval, num_classes):
  """Get generated images."""
  noise = tf.random_normal([num_images_generated, 64])
  # If conditional, generate class-specific images.
  if conditional_eval:
    conditioning = util.get_generator_conditioning(
        num_images_generated, num_classes)
    generator_inputs = (noise, conditioning)
    generator_fn = networks.conditional_generator
  else:
    generator_inputs = noise
    generator_fn = networks.generator
  # In order for variables to load, use the same variable scope as in the
  # train job.
  with tf.variable_scope('Generator'):
    data = generator_fn(generator_inputs, is_training=False)

  return data 
Example #6
Source File: util_test.py    From yolo_v2 with Apache License 2.0 5 votes vote down vote up
def test_get_generator_conditioning(self):
    conditioning = util.get_generator_conditioning(12, 4)
    self.assertEqual([12, 4], conditioning.shape.as_list()) 
Example #7
Source File: util_test.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def test_get_generator_conditioning(self):
    conditioning = util.get_generator_conditioning(12, 4)
    self.assertEqual([12, 4], conditioning.shape.as_list()) 
Example #8
Source File: util_test.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
def test_get_generator_conditioning(self):
    conditioning = util.get_generator_conditioning(12, 4)
    self.assertEqual([12, 4], conditioning.shape.as_list()) 
Example #9
Source File: util_test.py    From g-tensorflow-models with Apache License 2.0 5 votes vote down vote up
def test_get_generator_conditioning(self):
    conditioning = util.get_generator_conditioning(12, 4)
    self.assertEqual([12, 4], conditioning.shape.as_list()) 
Example #10
Source File: util_test.py    From multilabel-image-classification-tensorflow with MIT License 5 votes vote down vote up
def test_get_generator_conditioning(self):
    conditioning = util.get_generator_conditioning(12, 4)
    self.assertEqual([12, 4], conditioning.shape.as_list())