Commit 4bb777dc authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'migrationfix' into 'master'

Fix error related to bob.measure->bob.bio.base movings

Closes #4

See merge request !14
parents 90788ed5 710a8d1f
Pipeline #19941 passed with stages
in 20 minutes and 49 seconds
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
from __future__ import print_function from __future__ import print_function
import bob.measure
import os import os
import shutil import shutil
...@@ -44,7 +43,7 @@ def _spoof(parameters, cur_test_dir, sub_dir, score_types=('dev-real',), scores_ ...@@ -44,7 +43,7 @@ def _spoof(parameters, cur_test_dir, sub_dir, score_types=('dev-real',), scores_
for i in range(0, len(score_types)): for i in range(0, len(score_types)):
data2check = [] data2check = []
for sfile in (score_files[i], reference_files[i]): for sfile in (score_files[i], reference_files[i]):
f = bob.measure.load.open_file(sfile) f = bob.bio.base.score.load.open_file(sfile)
d_ = [] d_ = []
for line in f: for line in f:
if isinstance(line, bytes): line = line.decode('utf-8') if isinstance(line, bytes): line = line.decode('utf-8')
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
from __future__ import print_function from __future__ import print_function
import numpy import numpy
import bob.measure import bob.bio.base
import os.path import os.path
import bob.core import bob.core
...@@ -22,7 +22,7 @@ def load_noattacks_scores(filename): ...@@ -22,7 +22,7 @@ def load_noattacks_scores(filename):
male_pos = [] male_pos = []
# read four column list line by line # read four column list line by line
for (client_id, probe_id, filename, score) in bob.measure.load.four_column(filename): for (client_id, probe_id, filename, score) in bob.bio.base.score.load.four_column(filename):
if client_id == probe_id: if client_id == probe_id:
if 'female' in filename: if 'female' in filename:
female_pos.append(score) female_pos.append(score)
...@@ -47,7 +47,7 @@ def load_attack_scores(scores_filename, support="all", adevice="all", recdevice= ...@@ -47,7 +47,7 @@ def load_attack_scores(scores_filename, support="all", adevice="all", recdevice=
negatives = [] negatives = []
# read four column list line by line # read four column list line by line
for (client_id, probe_id, filename, score) in bob.measure.load.four_column(scores_filename): for (client_id, probe_id, filename, score) in bob.bio.base.score.load.four_column(scores_filename):
if client_id == probe_id: if client_id == probe_id:
# if (support in filename or support == "all") and \ # if (support in filename or support == "all") and \
# (adevice in filename or adevice == "all") and \ # (adevice in filename or adevice == "all") and \
...@@ -74,7 +74,7 @@ def scores_to_dict(filename, support="all", adevice="all", recdevice="all"): ...@@ -74,7 +74,7 @@ def scores_to_dict(filename, support="all", adevice="all", recdevice="all"):
negatives = {} negatives = {}
# read four column list line by line # read four column list line by line
for (client_id, probe_id, filename, score) in bob.measure.load.four_column(filename): for (client_id, probe_id, filename, score) in bob.bio.base.score.load.four_column(filename):
if client_id == probe_id: if client_id == probe_id:
if (support in filename or support == "all") and \ if (support in filename or support == "all") and \
(adevice in filename or adevice == "all") and \ (adevice in filename or adevice == "all") and \
...@@ -124,4 +124,4 @@ def accumulate_scores(pad_scores_dir, avs_scores_dir, support="all", attackdevic ...@@ -124,4 +124,4 @@ def accumulate_scores(pad_scores_dir, avs_scores_dir, support="all", attackdevic
logger.info("%s %s %s: %d", logger.info("%s %s %s: %d",
system, group, score_types[2], len(all_scores[system][group][score_types[2]])) system, group, score_types[2], len(all_scores[system][group][score_types[2]]))
logger.info("%s %s %s: %d", system, group, type, len(all_scores[system][group][type])) logger.info("%s %s %s: %d", system, group, type, len(all_scores[system][group][type]))
return all_scores return all_scores
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment