Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evaluate_gpu.py #16

Open
s20163081161 opened this issue Jun 11, 2020 · 5 comments
Open

evaluate_gpu.py #16

s20163081161 opened this issue Jun 11, 2020 · 5 comments

Comments

@s20163081161
Copy link

@layumi 这博士你好。evaluate_gpu.py中的第53行, cmc[rows_good[0]:] = 1 这句代码,我感觉不太合适。cmc的长度是36935,是去除junk_index之前的index的长度;而rows_good所代表的索引是去除junk_index之后的index的,此时的index,在经过第45行的“index = index[mask]”之后,已经变短了,为36875。那“ cmc[rows_good[0]:] = 1”这句代码是不是不太合适啊??

@layumi
Copy link
Owner

layumi commented Jun 11, 2020

你好,index里面存的是序号, 通俗地说,是排序的顺序,变长变短不影响 。 不需要和cmc的长度一致。

@s20163081161
Copy link
Author

你好,index里面存的是序号, 通俗地说,是排序的顺序,变长变短不影响 。 不需要和cmc的长度一致。

但是投票的时候不是根据index里的序号来的,如下代码所示
“mask = np.in1d(index, good_index)
rows_good = np.argwhere(mask==True)
rows_good = rows_good.flatten()

cmc[rows_good[0]:] = 1”

@layumi
Copy link
Owner

layumi commented Jun 11, 2020

我们捋一下。

rows_good 已经是删除过同camera里面的index了,
然后这个index 还是原始cmc里面排序的序号。(删除一些index,不影响序号啊,只是可能断号了。比如原来【5,3,2,4,1】 现在变成【5,3,1】少了2,4,但是这个序号还是能用来索引)
所以能用在cmc上。

@s20163081161
Copy link
Author

我们捋一下。
rows_good 已经是删除过同camera里面的index了,
然后这个index 还是原始cmc里面排序的序号。(删除一些index,不影响序号啊,只是可能断号了。比如原来【5,3,2,4,1】 现在变成【5,3,1】少了2,4,但是这个序号还是能用来索引)
所以能用在cmc上。

我是这样理解的。

假设:
原始index = [6,7,5,3,2,4,1],则 cmc = [0,0,0,0,0,0,0] ,7位

假设junk_index = [6,7],则去除junk_index后:
index =[5,3,2,4,1]

假设good_index = [3,4,1],则:
mask = [false,true,false,true,true]
rows_good = [2,4,5],为mask为true的索引

经过“cmc[rows_good[0]:] = 1”,得
cmc = [0,1,1,1,1,1,1]

也就是说,cmc最终的赋值,跟index里面的序号没关,只和序号在index中的位置(比如序号3排在第二位)有关??

@layumi
Copy link
Owner

layumi commented Jun 12, 2020

啊,是这样的。junk是完全不算的(同camera的样本)。
所以你看新的 index =[5,3,2,4,1]
对应的 cmc = [0,1,1,1,1,1,1]

另外,你打错了,,rows_good = [1,3,4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants