code: def bbox2delta(src_boxes, tgt_boxes, weights=[1.0, 1.0, 1.0, 1.0]):
      """Encode bboxes to deltas."""
      src_w = src_boxes[:, 2] - src_boxes[:, 0]
      src_h = src_boxes[:, 3] - src_boxes[:, 1]
      src_ctr_x = src_boxes[:, 0] + 0.5 * src_w
      src_ctr_y = src_boxes[:, 1] + 0.5 * src_h
  
      tgt_w = tgt_boxes[:, 2] - tgt_boxes[:, 0]
      tgt_h = tgt_boxes[:, 3] - tgt_boxes[:, 1]
      tgt_ctr_x = tgt_boxes[:, 0] + 0.5 * tgt_w
      tgt_ctr_y = tgt_boxes[:, 1] + 0.5 * tgt_h
  
      wx, wy, ww, wh = weights
      dx = wx * (tgt_ctr_x - src_ctr_x) / src_w
      dy = wy * (tgt_ctr_y - src_ctr_y) / src_h
      dw = ww * paddle.log(tgt_w / src_w)
      dh = wh * paddle.log(tgt_h / src_h)
  
      deltas = paddle.stack((dx, dy, dw, dh), axis=1)
      return deltas
  
imports: import math
  import paddle
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: bbox2delta(src_boxes, tgt_boxes, weights) and returns: deltas