utils.py 文件源码

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

项目:crayimage 作者: yandexdataschool 项目源码 文件源码
def center_tracks(tracks, out=None):
  c = np.array(tracks.shape[1:], dtype='int') / 2

  if out is None:
    out = np.ndarray(shape=tracks.shape, dtype=tracks.dtype)

  for i in xrange(tracks.shape[0]):
    cm = np.array(center_of_mass(tracks[i, :, :]), dtype='int32')
    out[i, :, :] = shift(tracks[i, :, :], c - cm)

  return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号