new updated
This commit is contained in:
@ -116,15 +116,19 @@ def cluster(data, thresh=0.15):
|
||||
return clt_center
|
||||
|
||||
def calc_simil(event, stdfeat):
|
||||
'''事件与标准库的对比策略
|
||||
该比对策略是否可以拓展到事件与事件的比对?
|
||||
'''
|
||||
|
||||
def calsiml(feat1, feat2):
|
||||
|
||||
def calsiml(feat1, feat2, topkp=75, cluth=0.15):
|
||||
'''轨迹样本和标准特征集样本相似度的选择策略'''
|
||||
matrix = 1 - cdist(feat1, feat2, 'cosine')
|
||||
simi_max = []
|
||||
for i in range(len(matrix)):
|
||||
sim = np.mean(get_topk_percent(matrix[i, :], 75))
|
||||
sim = np.mean(get_topk_percent(matrix[i, :], topkp))
|
||||
simi_max.append(sim)
|
||||
cltc_max = cluster(simi_max)
|
||||
cltc_max = cluster(simi_max, cluth)
|
||||
Simi = max(cltc_max)
|
||||
|
||||
## cltc_max为空属于编程考虑不周,应予以排查解决
|
||||
@ -193,8 +197,6 @@ def simi_matrix():
|
||||
histpath = os.path.join(resultPath, "simi_hist")
|
||||
if not os.path.exists(histpath):
|
||||
os.makedirs(histpath)
|
||||
|
||||
|
||||
|
||||
mean_values, max_values = [], []
|
||||
cameras = ('front', 'back')
|
||||
|
Reference in New Issue
Block a user