Ejemplo n.º 1
0
    data_common.output_file(values, maps)

if options.test_type == 'liveness':
    new_result_ = "{0}{1}{2}-result_.csv".format(directory, os.sep, version)
    shutil.copyfile(result, new_result_)
    cmd = "sed -i  's#-1#1#' {}".format(new_result_)
    subprocess.call(cmd, shell=True)
    time.sleep(3)

    if options.data_type == 'base':
        replace = '/home/andrew/code/data/tof/base_test_data/vivo-liveness/'
    else:
        replace = ''
    servers.get_liveness_server_result(new_result,
                                       file_name,
                                       label_name,
                                       replace=replace,
                                       error_name=error_name,
                                       type_=options.data_type)

    roc = "{0}{1}{2}-roc.txt".format(directory, os.sep, version)
    fprs = np.arange(0.10, 0, -0.01)
    count.roc(new_result_, label_name, output=roc, fprs=fprs)

if options.test_type == 'gaze':
    fprs = [0.3, 0.25, 0.2, 0.15, 0.1, 0.05, 0.02, 0.01, 0.001]
    roc = "{0}{1}{2}-roc.txt".format(directory, os.sep, version)
    count.roc(
        result,
        label_name,
        fprs=fprs,
        output=roc,
Ejemplo n.º 2
0
if options.test_type == 'liveness':
    new_result_ = "{0}{1}{2}-result_.csv".format(directory, os.sep, version)
    shutil.copyfile(result, new_result_)
    cmd = "sed -i  's#-1#1#' {}".format(new_result_)
    subprocess.call(cmd, shell=True)
    time.sleep(3)

    if options.data_type == 'base':
        replace = '/home/andrew/code/data/tof/base_test_data/vivo-liveness/'
    else:
        replace = ''

    df1, df2, df3, df4 = servers.get_liveness_server_result(
        new_result,
        file_name,
        label_name,
        score=options.score,
        replace=replace,
        error_name=error_name,
        type_=options.data_type)

    roc = "{0}{1}{2}-roc.txt".format(directory, os.sep, version)
    fprs = [0.0 + 0.1 * p for p in np.arange(1, 10)]
    count.roc(new_result, label_name, output=roc, fprs=fprs)

    t1 = '参数:\n{}\n结果目录:\n{}\n配置文件:\n{}\nROC:\n{}\n'.format(
        " ".join(sys.argv), directory,
        open(config_name).read(),
        open(roc).read())

    t2 = 'FAR_FRR:\n{}\n分类统计:\n{}'.format(df4.to_string(), df3.to_string())
Ejemplo n.º 3
0
    values = "{0}{1}{2}-values.csv".format(directory, os.sep, version)
    maps = data_common.concat_file(new_result, file_name, sep=',')
    data_common.output_file(values, maps)    

if options.test_type == 'liveness':
    new_result_ = "{0}{1}{2}-result_.csv".format(directory, os.sep, version)
    shutil.copyfile(result, new_result_)
    cmd = "sed -i  's#-1#1#' {}".format(new_result_)
    subprocess.call(cmd,shell=True)
     
    if options.data_type == 'base':
        replace = '/home/andrew/code/data/tof/base_test_data/vivo-liveness/'
    else:
        replace = ''
    error_name = "{0}{1}{2}-result.xlsx".format(directory, os.sep, version)
    servers.get_liveness_server_result(new_result, file_name, label_name, 
        replace=replace, error_name=error_name)

    roc = "{0}{1}{2}-roc.txt".format(directory, os.sep, version)
    count.roc(new_result_, label_name, output=roc)

if options.test_type == 'gaze':
    fprs = [0.3,0.25,0.2,0.15,0.1,0.05,0.02,0.01,0.001]
    roc = "{0}{1}{2}-roc.txt".format(directory, os.sep, version)
    count.roc(result, label_name, fprs=fprs, output=roc, ) 
    error_name = "{0}{1}{2}-result.xlsx".format(directory, os.sep, version)
    servers.get_gaze_server_result(new_result, file_name, label_name, 
        error_name=error_name)    



    
Ejemplo n.º 4
0
parser = argparse.ArgumentParser()
parser.add_argument('labels', action="store", help=u'labels')
parser.add_argument('files', action="store", help=u'测试图片列表文件')
parser.add_argument('scores', action="store", help=u'服务器liveness结果')
parser.add_argument('-s',
                    action="store",
                    dest="score",
                    default=0.99,
                    type=float,
                    help=u'分数的门限')
parser.add_argument('-r',
                    action="store_true",
                    default=False,
                    help=u' 是否用中文用例名字替换数字。')
parser.add_argument('-o',
                    action="store",
                    dest="output",
                    default="live_result.xlsx",
                    help=u'结果输出目录')
parser.add_argument('--version',
                    action='version',
                    version='%(prog)s 1.0 Rongzhong xu 2018 04 18')
options = parser.parse_args()

servers.get_liveness_server_result(options.scores,
                                   options.files,
                                   options.labels,
                                   score=options.score,
                                   error_name=options.output)