def test_frames_as_numpy_array_should_frames_as_numpy_array(self): batch = FrameBatch(frames=[ Frame(1, np.ones((1, 1)), None), Frame(1, np.ones((1, 1)), None) ], info=None) expected = list(np.ones((2, 1, 1))) actual = list(batch.frames_as_numpy_array()) self.assertEqual(expected, actual)
def classify(self, batch: FrameBatch) -> List[Prediction]: frames = batch.frames_as_numpy_array() (prediction_classes, prediction_scores, prediction_boxes) = self._get_predictions(frames) return Prediction.predictions_from_batch_and_lists( batch, prediction_classes, prediction_scores, boxes=prediction_boxes)
def process_frames(self, batch: FrameBatch) -> List[DepthEstimationResult]: frames = batch.frames_as_numpy_array() (segms, depths) = self._get_depth_estimation(frames) return DepthEstimationResult.depth_estimation_result_from_batch_and_lists( batch, segms, depths)