def proposals(self, X, return_index=False):
"""Retrieve proposals for a video based on its duration
Parameters
----------
X : ndarray
m x 1 array with video duration
Outputs
-------
Y : ndarray
m * n_prop x 2 array with temporal proposals
"""
if self.priors is None:
raise ValueError('model has not been trained')
Y = np.kron(np.expand_dims(X, 1), self.priors)
idx = np.repeat(np.arange(X.shape[0]), self.n_prop)
if return_index:
return Y, idx
return Y
data_generation.py 文件源码
python
阅读 44
收藏 0
点赞 0
评论 0
评论列表
文章目录