Open ahangchen opened 7 years ago
Hi, @ahangchen, I'm sorry I'm very busy recently. I think the problem is the following code:
for ig in IGNORE: if ig < k: ig_cnt += 1 else: break
The original code is len(query_info)TEST_NUM at most. However, your code is en(query_info)len(YES)*len(IGNORE) at most.
@hehefan The original code time consumption is 2len(query_info)TEST_NUM, and this code time consumption is len(query_info)TEST_NUM + len(query)len(YES)*len(YES), the third factor is not len(IGNORE) but len(YES) at most because of the break sentence. len(YES) is very small, thus this code is quite faster than the origin code
.
And my question is about the mAP value but not the time consumption. I can't figure out this from your reply (you're talking about the time consumption, right?)
I think the evaluate code is slow too. Especially testing models for Market, which needs about 90 minutes. But testing Duke models only needs several mins. Can your code do this job much faster than the original code? @ahangchen
@ericxian1997 Yes, much faster, try it.
I find the evaluate code running very slow when predict accuracy is low, and manage to accelerate the evaluation.
The key point is, when we get the
match
andjunk
array, we can also get the indexes of these person id inresult_argsort
. With these indexes, we can compute therank_1
and'mAP' value in a much smaller double cycle.Although this code can compute rank_1_acc and mAP very fast (in 3 minute) and rank_1_acc is the same with the origin code, but mAP is a little larger than the origin result.
Is there anything wrong with this code?