code: def get_centers_by_id(self, x_rgb, x_ir, targets):
      centers_rgb = []
      centers_ir = []
  
      batch_y_set = set(targets.data.cpu().numpy())
  
      for _, l in enumerate(batch_y_set):
          feat1 = x_rgb[targets == l]
          feat2 = x_ir[targets == l]
  
          centers_rgb.append(feat1.mean(dim=0).unsqueeze(0))
          centers_ir.append(feat2.mean(dim=0).unsqueeze(0))
  
      centers_rgb = torch.cat(centers_rgb, 0).cuda()
      centers_ir = torch.cat(centers_ir, 0).cuda()
  
      return centers_rgb, centers_ir
  
file_path: insightface/recognition/idmmd/losses.py
imports: import torch
  from torch import nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the IDMMD obj's underlying member method code with example usage: obj.get_centers_by_id(x_rgb, x_ir, targets) and returns: centers_rgb,  centers_ir