Esempio n. 1
0
# anlyse result
if options.test_type == 'detect':
    result = "{0}{1}{2}{1}{2}_output%files.txt.txt".format(
        tool, os.sep, options.test_type)
else:
    result = "{0}{1}{2}{1}{2}_output%files.txt.csv".format(
        tool, os.sep, options.test_type)

if options.test_type == 'verify':
    result = "{0}{1}{2}{1}{2}_score_output%i_enroll.txt.csv".format(
        tool, os.sep, options.test_type)
    print(result)

time.sleep(3)
servers.wait_until_stop('sample')

time.sleep(3)

new_result = "{0}{1}{2}-result.csv".format(directory, os.sep, version)
print(result)
print(new_result)
shutil.copyfile(result, new_result)
error_name = "{0}{1}{2}----result.xlsx".format(directory, os.sep, version)

if options.test_type == 'detect':
    # 生成图片
    names = data_common.file2list(result, basename=True)
    data_common.output_file('/home/andrew/code/tmp/detection_results.txt',
                            names)
    subprocess.call(
Esempio n. 2
0
shutil.copyfile(config_name, 
                "{}{}{}".format(directory, os.sep,os.path.basename(config_name)))
cmd = "{} && {}".format(cmd1,types[options.test_type]['cmd'])
print(cmd)
subprocess.call(cmd,shell=True)

print("Please see result in {}".format(directory))

# wait for result
if not options.w:
    exit(0)

# anlyse result
result = "{0}{1}{2}{1}{2}_output%files.txt.csv".format(
    tool, os.sep, options.test_type)
servers.wait_until_stop(types[options.test_type]['process'])
new_result = "{0}{1}{2}-result.csv".format(directory, os.sep, version)
shutil.copyfile(result, new_result)

if options.test_type != 'verify':
    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':