Esempio n. 1
0
def output_results(log_path, batch_id, epoch, input_xyz, skel_xyz, skel_r, A_init=None, A_final=None):
    batch_size = skel_xyz.size()[0]
    batch_id = batch_id.numpy()
    input_xyz_save = input_xyz.detach().cpu().numpy()
    skel_xyz_save = skel_xyz.detach().cpu().numpy()
    skel_r_save = skel_r.detach().cpu().numpy()

    if A_init is not None:
        A_init_save = A_init.detach().cpu().numpy()
    if A_final is not None:
        A_final_save = A_final.detach().cpu().numpy()

    for i in range(batch_size):

        save_name_input = log_path + str(batch_id[i]) + "_input.off"
        save_name_sphere = log_path + str(batch_id[i]) + "_sphere_" + str(epoch) + ".obj"
        save_name_center = log_path + str(batch_id[i]) + "_center_" + str(epoch) + ".off"
        
        save_name_A_init = log_path + str(batch_id[i]) + "_graph_init_" + str(epoch) + ".obj"
        save_name_A_final = log_path + str(batch_id[i]) + "_graph_final_" + str(epoch) + ".obj"
        
        rw.save_off_points(input_xyz_save[i], save_name_input)
        rw.save_spheres(skel_xyz_save[i], skel_r_save[i], save_name_sphere)
        rw.save_off_points(skel_xyz_save[i], save_name_center)

        if A_init is not None:
            rw.save_graph(skel_xyz_save[i], A_init_save[i], save_name_A_init)
        if A_final is not None:
            rw.save_graph(skel_xyz_save[i], A_final_save[i], save_name_A_final)
Esempio n. 2
0
def output_results(log_path,
                   batch_id,
                   input_xyz,
                   skel_xyz,
                   skel_r,
                   skel_faces,
                   skel_edges,
                   A_init=None,
                   A_pred=None,
                   A_final=None):
    batch_size = skel_xyz.size()[0]
    batch_id = batch_id.numpy()
    input_xyz_save = input_xyz.detach().cpu().numpy()
    skel_xyz_save = skel_xyz.detach().cpu().numpy()
    skel_r_save = skel_r.detach().cpu().numpy()

    if A_init is not None:
        A_init_save = A_init.detach().cpu().numpy()
    if A_pred is not None:
        A_pred_save = A_pred.detach().cpu().numpy()
    if A_final is not None:
        A_final_save = A_final.detach().cpu().numpy()

    for i in range(batch_size):

        save_name_input = log_path + str(batch_id[i]) + "_input.off"
        save_name_sphere = log_path + str(batch_id[i]) + "_sphere" + ".obj"
        save_name_center = log_path + str(batch_id[i]) + "_center" + ".off"
        save_name_f = log_path + str(batch_id[i]) + "_face" + ".obj"
        save_name_e = log_path + str(batch_id[i]) + "_edge" + ".obj"
        save_name_A_init = log_path + str(batch_id[i]) + "_graph_init" + ".obj"
        save_name_A_pred = log_path + str(batch_id[i]) + "_graph_pred" + ".obj"
        save_name_A_final = log_path + str(
            batch_id[i]) + "_graph_final" + ".obj"

        rw.save_off_points(input_xyz_save[i], save_name_input)
        rw.save_spheres(skel_xyz_save[i], skel_r_save[i], save_name_sphere)
        rw.save_off_points(skel_xyz_save[i], save_name_center)
        rw.save_skel_mesh(skel_xyz_save[i], skel_faces[i], skel_edges[i],
                          save_name_f, save_name_e)

        if A_init is not None:
            rw.save_graph(skel_xyz_save[i], A_init_save[i], save_name_A_init)
        if A_pred is not None:
            rw.save_graph(skel_xyz_save[i], A_pred_save[i], save_name_A_pred)
        if A_final is not None:
            rw.save_graph(skel_xyz_save[i], A_final_save[i], save_name_A_final)
Esempio n. 3
0
def output_results(log_path, batch_id, input_xyz, skel_xyz, skel_r, skel_faces,
                   skel_edges, A_mesh):

    batch_size = skel_xyz.size()[0]
    batch_id = batch_id.numpy()
    input_xyz_save = input_xyz.detach().cpu().numpy()
    skel_xyz_save = skel_xyz.detach().cpu().numpy()
    skel_r_save = skel_r.detach().cpu().numpy()

    for i in range(batch_size):

        save_name_input = log_path + str(batch_id[i]) + "_input.off"
        save_name_sphere = log_path + str(batch_id[i]) + "_sphere" + ".obj"
        save_name_center = log_path + str(batch_id[i]) + "_center" + ".off"
        save_name_f = log_path + str(batch_id[i]) + "_skel_face" + ".obj"
        save_name_e = log_path + str(batch_id[i]) + "_skel_edge" + ".obj"
        save_name_A_mesh = log_path + str(batch_id[i]) + "_mesh_graph" + ".obj"

        rw.save_off_points(input_xyz_save[i], save_name_input)
        rw.save_spheres(skel_xyz_save[i], skel_r_save[i], save_name_sphere)
        rw.save_off_points(skel_xyz_save[i], save_name_center)
        rw.save_skel_mesh(skel_xyz_save[i], skel_faces[i], skel_edges[i],
                          save_name_f, save_name_e)
        rw.save_graph(skel_xyz_save[i], A_mesh[i], save_name_A_mesh)