new updated

This commit is contained in:
王庆刚
2025-03-19 17:39:26 +08:00
parent 9b5b135fa3
commit f14faa323e
4 changed files with 53 additions and 18 deletions

View File

@ -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')

View File

@ -57,7 +57,13 @@ def save_imgpairs(barcode, imgpaths, matrix, savepath, thresh=(0.4, 0.6), ctype=
def feat_analysis(featpath):
def feat_analysis(featpath):
'''
标准特征集中样本类内、类间相似度分布
'''
savepath = r"D:\exhibition\result\stdfeat"
InterThresh = (0.4, 0.6)