Python object_detection.utils.ops.reduce_sum_trailing_dimensions() Examples

The following are 16 code examples of object_detection.utils.ops.reduce_sum_trailing_dimensions(). 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 vehicle_counting_tensorflow with MIT License 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #2
Source File: ops_test.py    From ros_people_object_detection_tensorflow with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #3
Source File: ops_test.py    From Person-Detection-and-Tracking with MIT License 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #4
Source File: ops_test.py    From Traffic-Rule-Violation-Detection-System with MIT License 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #5
Source File: ops_test.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #6
Source File: ops_test.py    From ros_tensorflow with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #7
Source File: ops_test.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #8
Source File: ops_test.py    From Live-feed-object-device-identification-using-Tensorflow-and-OpenCV with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #9
Source File: ops_test.py    From Elphas with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #10
Source File: ops_test.py    From monopsr with MIT License 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
        input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
        reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
        with self.test_session() as sess:
            reduced_np = sess.run(reduced_tensor,
                                  feed_dict={input_tensor: np.ones((2, 2, 2),
                                                                   np.float32)})
        self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #11
Source File: ops_test.py    From AniSeg with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #12
Source File: ops_test.py    From MAX-Object-Detector with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #13
Source File: ops_test.py    From open-solution-googleai-object-detection with MIT License 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #14
Source File: ops_test.py    From g-tensorflow-models with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #15
Source File: ops_test.py    From models with Apache License 2.0 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):

    def graph_fn(input_tensor):
      reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
      return reduced_tensor

    reduced_np = self.execute(graph_fn, [np.ones((2, 2, 2), np.float32)])
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32)) 
Example #16
Source File: ops_test.py    From multilabel-image-classification-tensorflow with MIT License 5 votes vote down vote up
def test_reduce_sum_trailing_dimensions(self):
    input_tensor = tf.placeholder(tf.float32, shape=[None, None, None])
    reduced_tensor = ops.reduce_sum_trailing_dimensions(input_tensor, ndims=2)
    with self.test_session() as sess:
      reduced_np = sess.run(reduced_tensor,
                            feed_dict={input_tensor: np.ones((2, 2, 2),
                                                             np.float32)})
    self.assertAllClose(reduced_np, 2 * np.ones((2, 2), np.float32))