Python object_detection.utils.ops.normalize_to_target() Examples
The following are 30
code examples of object_detection.utils.ops.normalize_to_target().
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
object_detection.utils.ops
, or try the search function
.
Example #1
Source File: ops_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
def test_create_normalize_to_target(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.op.name, 'NormalizeToTarget/mul') var_name = tf.contrib.framework.get_variables()[0].name self.assertEqual(var_name, 'NormalizeToTarget/weights:0')
Example #2
Source File: ops_test.py From hands-detection with MIT License | 5 votes |
def test_invalid_dim(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 10 with self.assertRaisesRegexp( ValueError, 'dim must be non-negative but smaller than the input rank.'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #3
Source File: ops_test.py From moveo_ros with MIT License | 5 votes |
def test_create_normalize_to_target(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.op.name, 'NormalizeToTarget/mul') var_name = tf.contrib.framework.get_variables()[0].name self.assertEqual(var_name, 'NormalizeToTarget/weights:0')
Example #4
Source File: ops_test.py From hands-detection with MIT License | 5 votes |
def test_correct_output_shape(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.get_shape().as_list(), inputs.get_shape().as_list())
Example #5
Source File: ops_test.py From hands-detection with MIT License | 5 votes |
def test_correct_initial_output_values(self): inputs = tf.constant([[[[3, 4], [7, 24]], [[5, -12], [-1, 0]]]], tf.float32) target_norm_value = 10.0 dim = 3 expected_output = [[[[30/5.0, 40/5.0], [70/25.0, 240/25.0]], [[50/13.0, -120/13.0], [-10, 0]]]] with self.test_session() as sess: normalized_inputs = ops.normalize_to_target(inputs, target_norm_value, dim) sess.run(tf.global_variables_initializer()) output = normalized_inputs.eval() self.assertAllClose(output, expected_output)
Example #6
Source File: ops_test.py From hands-detection with MIT License | 5 votes |
def test_invalid_target_norm_values(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = [4.0, 4.0] dim = 3 with self.assertRaisesRegexp( ValueError, 'target_norm_value must be a float or a list of floats'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #7
Source File: ops_test.py From moveo_ros with MIT License | 5 votes |
def test_correct_initial_output_values(self): inputs = tf.constant([[[[3, 4], [7, 24]], [[5, -12], [-1, 0]]]], tf.float32) target_norm_value = 10.0 dim = 3 expected_output = [[[[30/5.0, 40/5.0], [70/25.0, 240/25.0]], [[50/13.0, -120/13.0], [-10, 0]]]] with self.test_session() as sess: normalized_inputs = ops.normalize_to_target(inputs, target_norm_value, dim) sess.run(tf.global_variables_initializer()) output = normalized_inputs.eval() self.assertAllClose(output, expected_output)
Example #8
Source File: ops_test.py From moveo_ros with MIT License | 5 votes |
def test_correct_output_shape(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.get_shape().as_list(), inputs.get_shape().as_list())
Example #9
Source File: ops_test.py From moveo_ros with MIT License | 5 votes |
def test_invalid_target_norm_values(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = [4.0, 4.0] dim = 3 with self.assertRaisesRegexp( ValueError, 'target_norm_value must be a float or a list of floats'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #10
Source File: ops_test.py From moveo_ros with MIT License | 5 votes |
def test_invalid_dim(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 10 with self.assertRaisesRegexp( ValueError, 'dim must be non-negative but smaller than the input rank.'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #11
Source File: ops_test.py From hands-detection with MIT License | 5 votes |
def test_create_normalize_to_target(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.op.name, 'NormalizeToTarget/mul') var_name = tf.contrib.framework.get_variables()[0].name self.assertEqual(var_name, 'NormalizeToTarget/weights:0')
Example #12
Source File: ops_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
def test_correct_initial_output_values(self): inputs = tf.constant([[[[3, 4], [7, 24]], [[5, -12], [-1, 0]]]], tf.float32) target_norm_value = 10.0 dim = 3 expected_output = [[[[30/5.0, 40/5.0], [70/25.0, 240/25.0]], [[50/13.0, -120/13.0], [-10, 0]]]] with self.test_session() as sess: normalized_inputs = ops.normalize_to_target(inputs, target_norm_value, dim) sess.run(tf.global_variables_initializer()) output = normalized_inputs.eval() self.assertAllClose(output, expected_output)
Example #13
Source File: ops_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
def test_correct_output_shape(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.get_shape().as_list(), inputs.get_shape().as_list())
Example #14
Source File: ops_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
def test_invalid_target_norm_values(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = [4.0, 4.0] dim = 3 with self.assertRaisesRegexp( ValueError, 'target_norm_value must be a float or a list of floats'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #15
Source File: ops_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
def test_invalid_dim(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 10 with self.assertRaisesRegexp( ValueError, 'dim must be non-negative but smaller than the input rank.'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #16
Source File: ops_test.py From ros_tensorflow with Apache License 2.0 | 5 votes |
def test_create_normalize_to_target(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.op.name, 'NormalizeToTarget/mul') var_name = tf.contrib.framework.get_variables()[0].name self.assertEqual(var_name, 'NormalizeToTarget/weights:0')
Example #17
Source File: ops_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
def test_correct_initial_output_values(self): inputs = tf.constant([[[[3, 4], [7, 24]], [[5, -12], [-1, 0]]]], tf.float32) target_norm_value = 10.0 dim = 3 expected_output = [[[[30/5.0, 40/5.0], [70/25.0, 240/25.0]], [[50/13.0, -120/13.0], [-10, 0]]]] with self.test_session() as sess: normalized_inputs = ops.normalize_to_target(inputs, target_norm_value, dim) sess.run(tf.global_variables_initializer()) output = normalized_inputs.eval() self.assertAllClose(output, expected_output)
Example #18
Source File: ops_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
def test_correct_output_shape(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.get_shape().as_list(), inputs.get_shape().as_list())
Example #19
Source File: ops_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
def test_invalid_target_norm_values(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = [4.0, 4.0] dim = 3 with self.assertRaisesRegexp( ValueError, 'target_norm_value must be a float or a list of floats'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #20
Source File: ops_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
def test_invalid_dim(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 10 with self.assertRaisesRegexp( ValueError, 'dim must be non-negative but smaller than the input rank.'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #21
Source File: ops_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
def test_create_normalize_to_target(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.op.name, 'NormalizeToTarget/mul') var_name = tf.contrib.framework.get_variables()[0].name self.assertEqual(var_name, 'NormalizeToTarget/weights:0')
Example #22
Source File: ops_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
def test_correct_initial_output_values(self): inputs = tf.constant([[[[3, 4], [7, 24]], [[5, -12], [-1, 0]]]], tf.float32) target_norm_value = 10.0 dim = 3 expected_output = [[[[30/5.0, 40/5.0], [70/25.0, 240/25.0]], [[50/13.0, -120/13.0], [-10, 0]]]] with self.test_session() as sess: normalized_inputs = ops.normalize_to_target(inputs, target_norm_value, dim) sess.run(tf.global_variables_initializer()) output = normalized_inputs.eval() self.assertAllClose(output, expected_output)
Example #23
Source File: ops_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
def test_correct_output_shape(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.get_shape().as_list(), inputs.get_shape().as_list())
Example #24
Source File: ops_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
def test_invalid_target_norm_values(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = [4.0, 4.0] dim = 3 with self.assertRaisesRegexp( ValueError, 'target_norm_value must be a float or a list of floats'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #25
Source File: ops_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
def test_invalid_dim(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 10 with self.assertRaisesRegexp( ValueError, 'dim must be non-negative but smaller than the input rank.'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #26
Source File: ops_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
def test_create_normalize_to_target(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.op.name, 'NormalizeToTarget/mul') var_name = tf.contrib.framework.get_variables()[0].name self.assertEqual(var_name, 'NormalizeToTarget/weights:0')
Example #27
Source File: ops_test.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
def test_correct_initial_output_values(self): inputs = tf.constant([[[[3, 4], [7, 24]], [[5, -12], [-1, 0]]]], tf.float32) target_norm_value = 10.0 dim = 3 expected_output = [[[[30/5.0, 40/5.0], [70/25.0, 240/25.0]], [[50/13.0, -120/13.0], [-10, 0]]]] with self.test_session() as sess: normalized_inputs = ops.normalize_to_target(inputs, target_norm_value, dim) sess.run(tf.global_variables_initializer()) output = normalized_inputs.eval() self.assertAllClose(output, expected_output)
Example #28
Source File: ops_test.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
def test_correct_output_shape(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 3 with self.test_session(): output = ops.normalize_to_target(inputs, target_norm_value, dim) self.assertEqual(output.get_shape().as_list(), inputs.get_shape().as_list())
Example #29
Source File: ops_test.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
def test_invalid_target_norm_values(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = [4.0, 4.0] dim = 3 with self.assertRaisesRegexp( ValueError, 'target_norm_value must be a float or a list of floats'): ops.normalize_to_target(inputs, target_norm_value, dim)
Example #30
Source File: ops_test.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
def test_invalid_dim(self): inputs = tf.random_uniform([5, 10, 12, 3]) target_norm_value = 4.0 dim = 10 with self.assertRaisesRegexp( ValueError, 'dim must be non-negative but smaller than the input rank.'): ops.normalize_to_target(inputs, target_norm_value, dim)