code: def oks_overlaps(kpt_preds, kpt_gts, kpt_valids, kpt_areas, sigmas):
      if not kpt_gts.astype("bool").any():
          return kpt_preds.sum() * 0
  
      sigmas = paddle.to_tensor(sigmas, dtype=kpt_preds.dtype)
      variances = (sigmas * 2) ** 2
  
      assert kpt_preds.shape[0] == kpt_gts.shape[0]
      kpt_preds = kpt_preds.reshape((-1, kpt_preds.shape[-1] // 2, 2))
      kpt_gts = kpt_gts.reshape((-1, kpt_gts.shape[-1] // 2, 2))
  
      squared_distance = (
          kpt_preds[:, :, 0] - kpt_gts[:, :, 0]
      ) ** 2 + (kpt_preds[:, :, 1] - kpt_gts[:, :, 1]) ** 2
      assert (kpt_valids.sum(-1) > 0).all()
      squared_distance0 = squared_distance / (
          kpt_areas[:, None] * variances[None, :] * 2
      )
      squared_distance1 = paddle.exp(-squared_distance0)
      squared_distance1 = squared_distance1 * kpt_valids
      oks = squared_distance1.sum(axis=1) / kpt_valids.sum(axis=1)
  
      return oks
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from itertools import cycle, islice
  from collections import abc
  import numpy
  import paddle
  import paddle.nn
  from ppdet.core.workspace import register, serializable
label_desc: Use image node_id 2 for calling a global function with example usage: oks_overlaps(kpt_preds, kpt_gts, kpt_valids, kpt_areas, sigmas) and returns: oks, unknown