c3d.py 文件源码

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

项目:deep-action-proposals 作者: escorciav 项目源码 文件源码
def read_feature(filename):
    """Read feature dump by C3D

    Parameters
    ----------
    filename : str
        Fullpath of file to read

    Outputs
    -------
    x : ndarray
        numpy array of features

    Note: It accomplishes the same purpose of this code:
        C3D/examples/c3d_feature_extraction/script/read_binary_blob.m

    """
    s_parr, d_parr = array.array('i'), array.array('f')
    with open(filename, 'r') as f:
        s_parr.fromfile(f, 5)
        s = np.array(s_parr)
        m = np.cumprod(s)[-1]

        d_parr.fromfile(f, m)
    return s, np.array(d_parr)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号