class_docstr: Streaming interface to allow for any source of predictions. 
  Initialize it, count predictions one by one, then print confusion matrix and intersection-union score
class_docstr_tok: ["Streaming","interface","to","allow","for","any","source","of","predictions",".","Initialize","it",",","count","predictions","one","by","one",",","then","print","confusion","matrix","and","intersection-union","score"]
code: def count_predicted_batch(self, ground_truth_vec, predicted):
      assert np.max(predicted) < self.number_of_labels
      if torch.is_tensor(ground_truth_vec):
          ground_truth_vec = ground_truth_vec.numpy()
      if torch.is_tensor(predicted):
          predicted = predicted.numpy()
      batch_confusion = np.bincount(
          self.number_of_labels * ground_truth_vec.astype(int)
          + predicted,
          minlength=self.number_of_labels**2,
      ).reshape(self.number_of_labels, self.number_of_labels)
      if self.confusion_matrix is None:
          self.confusion_matrix = batch_confusion
      else:
          self.confusion_matrix += batch_confusion
  
file_path: torch-points3d/torch_points3d/metrics/confusion_matrix.py
imports: import numpy
  import torch
  import os
label_desc: Use image node_id 3 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.count_predicted_batch(ground_truth_vec, predicted) without return types