render.py 文件源码

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

项目:picasso 作者: jungmannlab 项目源码 文件源码
def segment(locs, info, segmentation, kwargs={}, callback=None):
    Y = info[0]['Height']
    X = info[0]['Width']
    n_frames = info[0]['Frames']
    n_seg = n_segments(info, segmentation)
    bounds = _np.linspace(0, n_frames-1, n_seg+1, dtype=_np.uint32)
    segments = _np.zeros((n_seg, Y, X))
    if callback is not None:
        callback(0)
    for i in _trange(n_seg, desc='Generating segments', unit='segments'):
        segment_locs = locs[(locs.frame >= bounds[i]) & (locs.frame < bounds[i+1])]
        _, segments[i] = render(segment_locs, info, **kwargs)
        if callback is not None:
            callback(i+1)
    return bounds, segments
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号