Comments (2)
你好你好你说的这个功能我之前参考cluster-contrast-reid/clustercontrast/evaluators.py 评测代码实现一版,希望对你有帮助。
`class Evaluator(object):
def init(self, model):
super(Evaluator, self).init()
self.model = model
def evaluate(self, data_loader, query, gallery, cmc_flag=False, rerank=False):
features, _ = extract_features(self.model, data_loader)
distmat, query_features, gallery_features = pairwise_distance(features, query, gallery)
x = [f for f, _, _ in query]
y = [f for f, _, _ in gallery]
indices = np.argsort(distmat, axis=1)
for i, q_f_name in enumerate(x):
# q_f_name = query[i][0]
root_path = './query/spcl/{}'.format(i)
if not os.path.exists(root_path):
os.makedirs(root_path)
q_path = os.path.join(root_path, 'q')
if not os.path.exists(q_path):
os.makedirs(q_path)
g_path = os.path.join(root_path, 'g')
if not os.path.exists(g_path):
os.makedirs(g_path)
shutil.copy(q_f_name, os.path.join(q_path, os.path.basename(q_f_name)))
for j, index in enumerate(indices[i][:50]):
g_f_name = y[index]
g_name = '{}'.format(j) + '_' + os.path.basename(g_f_name)
g_name = os.path.join(g_path, g_name)
shutil.copy(g_f_name, g_name)
from cluster-contrast-reid.
你好你好你说的这个功能我之前参考cluster-contrast-reid/clustercontrast/evaluators.py 评测代码实现一版,希望对你有帮助。
`class Evaluator(object):
def init(self, model):
super(Evaluator, self).init()
self.model = modeldef evaluate(self, data_loader, query, gallery, cmc_flag=False, rerank=False): features, _ = extract_features(self.model, data_loader) distmat, query_features, gallery_features = pairwise_distance(features, query, gallery) x = [f for f, _, _ in query] y = [f for f, _, _ in gallery] indices = np.argsort(distmat, axis=1) for i, q_f_name in enumerate(x): # q_f_name = query[i][0] root_path = './query/spcl/{}'.format(i) if not os.path.exists(root_path): os.makedirs(root_path) q_path = os.path.join(root_path, 'q') if not os.path.exists(q_path): os.makedirs(q_path) g_path = os.path.join(root_path, 'g') if not os.path.exists(g_path): os.makedirs(g_path) shutil.copy(q_f_name, os.path.join(q_path, os.path.basename(q_f_name))) for j, index in enumerate(indices[i][:50]): g_f_name = y[index] g_name = '{}'.format(j) + '_' + os.path.basename(g_f_name) g_name = os.path.join(g_path, g_name) shutil.copy(g_f_name, g_name)
perfect!thank you very much !
from cluster-contrast-reid.
Related Issues (20)
- i see in the experiment you only train in batch 256,different from that in method like spcl,and is the good result get by larger batchsize? HOT 7
- How to determine the EPS parameters of DBSCAN for different datasets? HOT 1
- Can't reproduce MSMT17 results HOT 8
- 关于Memory Initialization的一点问题 HOT 4
- Why is the performance of the model trained with multi GPUs much better than that of the model trained with single GPU in this method? HOT 5
- 关于use hard的问题 HOT 4
- I downloaded the trained model you released, but only market and Dukle. Can you publish the model trained on VeRi? HOT 1
- PersonX 数据集上mAP只有36.0左右 HOT 6
- why don't use pseudo_labeled=-1 ?
- Why hard sampling is only beneficial for resnet_ibn_a?
- Why the result cannot be reproduced? HOT 2
- Different methods in memory update
- About the setting of batch_size and iter number HOT 1
- 为啥msmt17的指标sota都只有20多呢? HOT 1
- Warning: Leaking Caffe2 thread-pool after fork.
- Can't reproduce the result of MTMC17 to 33.3 using avg pooling HOT 2
- dataset HOT 4
- Why this paper is not accepted... HOT 1
- 运行问题 HOT 1
- cm模块中的backward代码好像没有起作用 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cluster-contrast-reid.