Ejemplo n.º 1
0
 def _check_predict(self):
     if self.return_values == 'detection':
         assert_is_detection_link(self.link, self.n_fg_class)
     elif self.return_values == 'instance_segmentation':
         assert_is_instance_segmentation_link(self.link, self.n_fg_class)
     elif self.return_values == 'rpn':
         imgs = [
             np.random.randint(
                 0, 256, size=(3, 480, 320)).astype(np.float32),
             np.random.randint(
                 0, 256, size=(3, 480, 320)).astype(np.float32)]
         result = self.link.predict(imgs)
         assert len(result) == 1
         assert len(result[0]) == len(imgs)
         for i in range(len(result[0])):
             roi = result[0][i]
             assert_is_bbox(roi)
Ejemplo n.º 2
0
 def test_predict_gpu(self):
     self.link.to_gpu()
     assert_is_instance_segmentation_link(self.link, self.n_class - 1)