meshrcnn/data/meshrcnn_transforms.py [299:314]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def load_unique_meshes(json_file, model_root):
    with PathManager.open(json_file, "r") as f:
        anns = json.load(f)["annotations"]
    # find unique models
    unique_models = []
    for obj in anns:
        model_type = obj["model"]
        if model_type not in unique_models:
            unique_models.append(model_type)
    # read unique models
    object_models = {}
    for model in unique_models:
        with PathManager.open(os.path.join(model_root, model), "rb") as f:
            mesh = load_obj(f, load_textures=False)
        object_models[model] = [mesh[0], mesh[1].verts_idx]
    return object_models
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



meshrcnn/evaluation/pix3d_evaluation.py [482:497]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def load_unique_meshes(json_file, model_root):
    with PathManager.open(json_file, "r") as f:
        anns = json.load(f)["annotations"]
    # find unique models
    unique_models = []
    for obj in anns:
        model_type = obj["model"]
        if model_type not in unique_models:
            unique_models.append(model_type)
    # read unique models
    object_models = {}
    for model in unique_models:
        with PathManager.open(os.path.join(model_root, model), "rb") as f:
            mesh = load_obj(f, load_textures=False)
        object_models[model] = [mesh[0], mesh[1].verts_idx]
    return object_models
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



