Open opentld opened 3 years ago
kdt is an exact NN method, while ngt is an approximate NN method.
The code is designed to use 'ngt' mode for K=32 because the patches are small so a lot of embeddings should be compared.
I recommend you to use 'ngt' mode for K=32 or simply skip K=32 and use only K=64 if 'ngt' is not available.
Sincerely
Just edit inspection.py, change the 'ngt' method to 'kdt', I don’t know what will happen, but the program is running... :) Is there any problem to do like this? @nuclearboy95
def eval_embeddings_NN_multiK(obj, embs64, embs32, NN=1): emb_tr, emb_te = embs64 maps_64 = measure_emb_NN(emb_te, emb_tr, method='kdt', NN=NN) maps_64 = distribute_scores(maps_64, (256, 256), K=64, S=16) det_64, seg_64 = assess_anomaly_maps(obj, maps_64)
maps_32 = measure_emb_NN(emb_te, emb_tr, method='ngt', NN=NN)