def get_histogram(self, data):
"""
Project the descriptions on to the codebook/vocabulary,
returning the histogram of words
[N x 1] => [1 x K] histogram
"""
if self.method == 'vq' or self.method == 'bow':
code = self.get_code(data)
code_hist = self.bow(data, code, self.K)
elif self.method == 'vlad':
code = self.get_code(data)
code_hist = self.vlad(data, code)
elif self.method == 'fisher':
code = self.get_code(data)
code_hist = self.fisher(data, code)
else:
raise NotImplementedError('''Histogram method %s not implemented. '''
'''Use vq/bow or vlad or fisher!''' % self.method)
return code_hist
评论列表
文章目录