original_docstring: Convert box coordinates to center and scale.
      adapted from https://github.com/Microsoft/human-pose-estimation.pytorch
      
docstring: Convert box coordinates to center and scale.
docstring_tokens: Convert box coordinates to center and scale .
code: def _box_to_center_scale(x, y, w, h, aspect_ratio=1.0, scale_mult=1.25):
      """Convert box coordinates to center and scale.
      adapted from https://github.com/Microsoft/human-pose-estimation.pytorch
      """
      pixel_std = 1
      center = np.zeros((2), dtype=np.float32)
      center[0] = x + w * 0.5
      center[1] = y + h * 0.5
  
      if w > aspect_ratio * h:
          h = w / aspect_ratio
      elif w < aspect_ratio * h:
          w = h * aspect_ratio
      scale = np.array(
          [w * 1.0 / pixel_std, h * 1.0 / pixel_std], dtype=np.float32)
      if center[0] != -1:
          scale = scale * scale_mult
      return center, scale
code_tokens: def _box_to_center_scale ( x , y , w , h , aspect_ratio = 1.0 , scale_mult = 1.25 ) : pixel_std = 1 center = np . zeros ( ( 2 ) , dtype = np . float32 ) center [ 0 ] = x + w * 0.5 center [ 1 ] = y + h * 0.5 if w > aspect_ratio * h : h = w / aspect_ratio elif w < aspect_ratio * h : w = h * aspect_ratio scale = np . array ( [ w * 1.0 / pixel_std , h * 1.0 / pixel_std ] , dtype = np . float32 ) if center [ 0 ] != - 1 : scale = scale * scale_mult return center , scale
short_docstring: Convert box coordinates to center and scale.
short_docstring_tokens: Convert box coordinates to center and scale .
comment: """Convert box coordinates to center and scale.
      adapted from https://github.com/Microsoft/human-pose-estimation.pytorch
      """