def predict(self, x: np.ndarray, batch_size: int = 128, **kwargs) -> list[dict[str, np.ndarray]]:
        """
        Perform prediction for a batch of inputs.

        :param x: Samples of shape NCHW or NHWC.
        :param batch_size: Batch size.
        :return: Predictions of format `list[dict[str, np.ndarray]]`, one for each input image. The fields of the dict
                 are as follows:

                 - boxes [N, 4]: the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
                 - labels [N]: the labels for each image
                 - scores [N]: the scores or each prediction.
        """
        predictions = []

        for x_i in tqdm(x, desc="ObjectSeeker", disable=not self.verbose):
            base_preds, masked_preds = self._masked_predictions(x_i, batch_size=batch_size, **kwargs)
            pruned_preds = self._prune_boxes(masked_preds, base_preds)
            unionized_preds = self._unionize_clusters(pruned_preds)

            preds = {
                "boxes": np.concatenate([base_preds["boxes"], unionized_preds["boxes"]]),
                "labels": np.concatenate([base_preds["labels"], unionized_preds["labels"]]),
                "scores": np.concatenate([base_preds["scores"], unionized_preds["scores"]]),
            }

            predictions.append(preds)

        return predictions

        Perform prediction for a batch of inputs.

        :param x: Samples of shape NCHW or NHWC.
        :param batch_size: Batch size.
        :return: Predictions of format `list[dict[str, np.ndarray]]`, one for each input image. The fields of the dict
                 are as follows:

                 - boxes [N, 4]: the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
                 - labels [N]: the labels for each image
                 - scores [N]: the scores or each prediction.
        
art/estimators/certification/object_seeker/object_seeker.py