1 Star 1 Fork 1

vegetable0511/ReID2024

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ensemble.py 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
vegetable0511 提交于 2024-03-27 19:12 . 5
import numpy as np
import os
distmat_paths = [
'logs-aic21/test/result/resnext101a_384/eucl_track/dist_mat.npy'
# './logs/stage2/resnext101a_384/v1/dist_mat.npy',
# './logs/stage2/resnext101a_384/v2/dist_mat.npy',
# './logs/stage2/101a_384/v1/dist_mat.npy',
# './logs/stage2/101a_384/v2/dist_mat.npy',
# './logs/stage2/101a_384_recrop/v1/dist_mat.npy',
# './logs/stage2/101a_384_recrop/v2/dist_mat.npy',
# './logs/stage2/101a_384_spgan/v1/dist_mat.npy',
# './logs/stage2/101a_384_spgan/v2/dist_mat.npy',
# './logs/stage2/densenet169a_384/v1/dist_mat.npy',
# './logs/stage2/densenet169a_384/v2/dist_mat.npy',
# './logs/stage2/s101_384/v1/dist_mat.npy',
# './logs/stage2/s101_384/v2/dist_mat.npy',
# './logs/stage2/se_resnet101a_384/v1/dist_mat.npy',
# './logs/stage2/se_resnet101a_384/v2/dist_mat.npy',
# './logs/stage2/transreid_256/v1/dist_mat.npy',
# './logs/stage2/transreid_256/v2/dist_mat.npy',
]
distmat = np.zeros((1103,31238))
# distmat = np.zeros((1678,11579))
for i in distmat_paths:
distmat += np.load(i)
sort_distmat_index = np.argsort(distmat, axis=1)
print(sort_distmat_index)
print('The shape of distmat is: {}'.format(distmat.shape))
save_path = 'logs-aic21/test/result/resnext101a_384/eucl_track/track2.txt'
with open(save_path,'w') as f:
for item in sort_distmat_index:
for i in range(99):
f.write(str(item[i] + 1) + ' ')
f.write(str(item[99] + 1) + '\n')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/vegetable0511/re-id2024.git
git@gitee.com:vegetable0511/re-id2024.git
vegetable0511
re-id2024
ReID2024
master

搜索帮助