Exemple #1
0
def process_one_file(config, file_name):
    print('Processing ', file_name)
    name_lm_vtk = os.path.splitext(file_name)[0] + '_landmarks.vtk'
    name_lm_txt = os.path.splitext(file_name)[0] + '_landmarks.txt'
    dm = deepmvlm.DeepMVLM(config)
    landmarks = dm.predict_one_file(file_name)
    dm.write_landmarks_as_vtk_points(landmarks, name_lm_vtk)
    dm.write_landmarks_as_text(landmarks, name_lm_txt)
    dm.visualise_mesh_and_landmarks(file_name, landmarks)
Exemple #2
0
def process_files_in_dir(config, dir_name):
    print('Processing files in  ', dir_name)
    names = Utils3D.get_mesh_files_in_dir(dir_name)
    print('Processing ', len(names), ' meshes')
    dm = deepmvlm.DeepMVLM(config)
    for file_name in names:
        print('Processing ', file_name)
        name_lm_txt = os.path.splitext(file_name)[0] + '_landmarks.txt'
        landmarks = dm.predict_one_file(file_name)
        dm.write_landmarks_as_text(landmarks, name_lm_txt)
Exemple #3
0
def process_file_list(config, file_name):
    print('Processing filelist ', file_name)
    names = []
    with open(file_name) as f:
        for line in f:
            line = (line.strip("/n")).strip("\n")
            if len(line) > 4:
                names.append(line)
    print('Processing ', len(names), ' meshes')
    dm = deepmvlm.DeepMVLM(config)
    for file_name in names:
        print('Processing ', file_name)
        name_lm_txt = os.path.splitext(file_name)[0] + '_landmarks.txt'
        landmarks = dm.predict_one_file(file_name)
        dm.write_landmarks_as_text(landmarks, name_lm_txt)
Exemple #4
0
def process_one_file(config, file_name):
    print('Processing ', file_name)
    name_lm_vtk = os.path.splitext(file_name)[0] + '_landmarks.vtk'
    name_lm_txt = os.path.splitext(file_name)[0] + '_landmarks.txt'
    dm = deepmvlm.DeepMVLM(config)
    landmarks = dm.predict_one_file(file_name)
    dm.write_landmarks_as_vtk_points(landmarks, name_lm_vtk)
    dm.write_landmarks_as_text(landmarks, name_lm_txt)
    dm.write_landmarks_as_ply_for_recognition(name_lm_txt)

    name_lm_ply = os.path.splitext(file_name)[0] + '_landmarks.ply'

    print(
        '################### test visualise mesh and landmarks ! #################### \n'
    )
    dm.visualise_mesh_and_landmarks(file_name, landmarks)
    obj3d_list = icpmatching.Icp3DMatching.read_obj_name_file(
        None)  # input is None or path of file
    process_icp_obj3d(obj3d_list, name_lm_ply)