def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
            input_path_postfix, output_path_root, output_dir_prefix)

    instances = load_instances(input_path, output_path, -1)
    filename = output_path + '/stats.csv'

    print "Saving the file..."
    print(filename)
    file = open(filename, 'w')

    num_attrs = len(attr_names)
    assert(len(attr_types) == num_attrs)

    for i in range(num_attrs):
        if attr_types[i] == librr.AttrType.number:
            all_attr_values = []
            for instance in instances:
                if not math.isnan(instance[i]):
                    all_attr_values.append(float(instance[i]))

            mean_value = np.average(np.array(all_attr_values))
            median_value = np.median(np.array(all_attr_values))
            stdev_value = np.std(np.array(all_attr_values))

            attr_name = attr_names[i].replace('_', ' ')
            file.write(attr_name + ',')
            file.write("{0:0.3f}".format(mean_value) + ',')
            file.write("{0:0.3f}".format(median_value) + ',')
            file.write("{0:0.3f}".format(stdev_value) + ',')
            file.write('\n')

    file.close()

    '''
Пример #2
0
def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
        input_path_postfix, output_path_root, output_dir_prefix)

    instances = load_instances(input_path, output_path, -1)
    filename = output_path + '/stats.csv'

    print "Saving the file..."
    print(filename)
    file = open(filename, 'w')

    num_attrs = len(attr_names)
    assert (len(attr_types) == num_attrs)

    for i in range(num_attrs):
        if attr_types[i] == librr.AttrType.number:
            all_attr_values = []
            for instance in instances:
                if not math.isnan(instance[i]):
                    all_attr_values.append(float(instance[i]))

            mean_value = np.average(np.array(all_attr_values))
            median_value = np.median(np.array(all_attr_values))
            stdev_value = np.std(np.array(all_attr_values))

            attr_name = attr_names[i].replace('_', ' ')
            file.write(attr_name + ',')
            file.write("{0:0.3f}".format(mean_value) + ',')
            file.write("{0:0.3f}".format(median_value) + ',')
            file.write("{0:0.3f}".format(stdev_value) + ',')
            file.write('\n')

    file.close()
    '''
Пример #3
0
def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
            input_path_postfix, output_path_root, output_dir_prefix)
    
    data_dirname = os.path.basename(os.path.normpath(sys.argv[1]))
    print(" >> " + data_dirname)

    (all_accu_values, all_comp_values, x_values) = load_instances(input_path, output_path)

    title = 'accu'
    plt.plot(x_values, all_accu_values[0], label='Recon. Symmetry (Ours)')
    plt.plot(x_values, all_accu_values[1], label='Recon. Database (Ours)')
    plt.plot(x_values, all_accu_values[2], label='Recon. Fusion (Ours)')
    plt.plot(x_values, all_accu_values[3], label='Part Assembly')
    plt.plot(x_values, all_accu_values[4], label='Symmetry Detection')
    plt.legend(loc=4)
    plt.xlim(0, max_x_value)
    plt.ylim(0, 1)
    plt.xlabel('Neighbor Distance')
    print(output_path_root + '/' + data_dirname + "_" + title)
    plt.savefig(output_path_root + '/' + data_dirname + "_" + title)
    plt.clf()
    
    title = 'comp'
    plt.plot(x_values, all_comp_values[0], label='Recon. Symmetry (Ours)')
    plt.plot(x_values, all_comp_values[1], label='Recon. Database (Ours)')
    plt.plot(x_values, all_comp_values[2], label='Recon. Fusion (Ours)')
    plt.plot(x_values, all_comp_values[3], label='Part Assembly')
    plt.plot(x_values, all_comp_values[4], label='Symmetry Detection')
    plt.legend(loc=4)
    plt.xlim(0, max_x_value)
    plt.ylim(0, 1)
    plt.xlabel('Neighbor Distance')
    print(output_path_root + '/' + data_dirname + "_" + title)
    plt.savefig(output_path_root + '/' + data_dirname + "_" + title)
Пример #4
0
def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
        input_path_postfix, output_path_root, output_dir_prefix)

    instances = load_instances(input_path, output_path, -1)
    html_filename = output_path + '/index.html'
    librr.write_html_table(instances, attr_names, attr_types,
                           dataset_name + ' (All)', html_filename)
    '''
def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
            input_path_postfix, output_path_root, output_dir_prefix)

    instances = load_instances(input_path, output_path, -1)
    html_filename = output_path + '/index.html'
    librr.write_html_table(instances, attr_names, attr_types, dataset_name + ' (All)', html_filename)

    '''
Пример #6
0
def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
            input_path_postfix, output_path_root, output_dir_prefix)

    instances = load_instances(input_path, output_path, -1)
    html_filename = output_path + '/index.html'
    librr.write_html_table(instances, attr_names, attr_types, dataset_name + ' (All)', html_filename)

    # For each part
    for i in range(len(symmetry_part_names)):
        instances = load_instances(input_path, output_path, i)
        html_filename = output_path + '/' + symmetry_part_names[i] + '.html'
        librr.write_html_table(instances, attr_names, attr_types,
                dataset_name + ' (' + symmetry_part_names[i].title() + ')', html_filename)
def main():
    input_path, output_path, dataset_name, symmetry_part_names = librr.parse_arguments(
            input_path_postfix, output_path_root, output_dir_prefix)
    
    load_instances(input_path, output_path, -1)