util.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:squeezeDet-hand 作者: fyhtea 项目源码 文件源码
def bbox_transform_inv(bbox):
  """convert a bbox of form [xmin, ymin, xmax, ymax] to [cx, cy, w, h]. Works
  for numpy array or list of tensors.
  """
  with tf.variable_scope('bbox_transform_inv') as scope:
    xmin, ymin, xmax, ymax = bbox
    out_box = [[]]*4

    width       = xmax - xmin + 1.0
    height      = ymax - ymin + 1.0
    out_box[0]  = xmin + 0.5*width 
    out_box[1]  = ymin + 0.5*height
    out_box[2]  = width
    out_box[3]  = height

  return out_box
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号