lsongx / DomainAdaptiveReID

MIT License
188 stars 50 forks source link

Hello,i find you use "tri_mat = np.triu(rerank_dist, 1)" in selftraining.py #21

Open xiaomao19970819 opened 4 years ago

xiaomao19970819 commented 4 years ago
        # DBSCAN cluster
        tri_mat = np.triu(rerank_dist, 1) # tri_mat.dim=2
        tri_mat = tri_mat[np.nonzero(tri_mat)] # tri_mat.dim=1
        tri_mat = np.sort(tri_mat,axis=None)
        top_num = np.round(args.rho*tri_mat.size).astype(int)
        eps = tri_mat[:top_num].mean()
        print('eps in cluster: {:.3f}'.format(eps))
        cluster = DBSCAN(eps=eps,min_samples=4,metric='precomputed', n_jobs=8)
xiaomao19970819 commented 4 years ago

Why is it necessary to generate an upper triangular matrix when clustering