Exemple #1
0
 def test_prune_outside_window(self):
     boxlist = np_box_list.BoxList(
         np.array([[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75],
                   [-0.2, -0.3, 0.7, 1.5]],
                  dtype=np.float32))
     boxlist_pruned, _ = np_box_list_ops.prune_outside_window(
         boxlist, [0.0, 0.0, 1.0, 1.0])
     expected_boxlist_pruned = np_box_list.BoxList(
         np.array([[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]],
                  dtype=np.float32))
     self.assertAllClose(expected_boxlist_pruned.get(),
                         boxlist_pruned.get())
 def test_prune_outside_window(self):
   boxlist = np_box_list.BoxList(
       np.array(
           [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75],
            [-0.2, -0.3, 0.7, 1.5]],
           dtype=np.float32))
   boxlist_pruned, _ = np_box_list_ops.prune_outside_window(
       boxlist, [0.0, 0.0, 1.0, 1.0])
   expected_boxlist_pruned = np_box_list.BoxList(
       np.array(
           [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
           np.float32))
   self.assertAllClose(expected_boxlist_pruned.get(), boxlist_pruned.get())