Skip to content
Snippets Groups Projects
Commit 72954641 authored by Amir Mohammadi's avatar Amir Mohammadi Committed by Amir MOHAMMADI
Browse files

pep8

parent dd2f424e
Branches
Tags
1 merge request!6Simplifications
......@@ -7,9 +7,11 @@ logger = bob.core.log.setup("bob.fusion.base")
def get_2negatives_1positive(score_lines):
gen_mask = score_lines['claimed_id'] == score_lines['real_id']
atk_mask = np.logical_or(np.char.count(score_lines['real_id'], 'spoof/') > 0,
np.char.count(score_lines['real_id'], 'attack') > 0)
zei_mask = np.logical_and(np.logical_not(gen_mask), np.logical_not(atk_mask))
atk_mask = np.logical_or(
np.char.count(score_lines['real_id'], 'spoof/') > 0,
np.char.count(score_lines['real_id'], 'attack') > 0)
zei_mask = np.logical_and(np.logical_not(
gen_mask), np.logical_not(atk_mask))
gen = score_lines[gen_mask]
zei = score_lines[zei_mask]
atk = score_lines[atk_mask]
......@@ -24,7 +26,8 @@ def check_consistency(gen_l, zei_l, atk_l):
continue
score_lines0 = score_lines_list[0]
for score_lines in score_lines_list[1:]:
assert(np.all(score_lines['claimed_id'] == score_lines0['claimed_id']))
assert(np.all(
score_lines['claimed_id'] == score_lines0['claimed_id']))
assert(np.all(score_lines['real_id'] == score_lines0['real_id']))
......@@ -99,12 +102,14 @@ def get_gza_from_lines_list(score_lines_list):
# find pad score of that id and replace the score
for real_id in real_ids:
# get the list of test_labels
test_labels = np.unique(temp['test_label'][temp['real_id'] == real_id])
test_labels = np.unique(
temp['test_label'][temp['real_id'] == real_id])
for test_label in test_labels:
idx3 = np.logical_and(temp['real_id'] == real_id,
temp['test_label'] == test_label)
idx4 = np.logical_and(gen_l[idx2]['real_id'] == real_id,
gen_l[idx2]['test_label'] == test_label)
idx4 = np.logical_and(
gen_l[idx2]['real_id'] == real_id,
gen_l[idx2]['test_label'] == test_label)
temp['score'][idx3] = gen_l[idx2]['score'][idx4]
zei_l[idx2] = temp
return idx1, gen_l, zei_l, atk_l
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment