3DTopia / OpenLRM

An open-source impl. of Large Reconstruction Models
Apache License 2.0
972 stars 56 forks source link

Training with .obj files #37

Open juanfraherrero opened 7 months ago

juanfraherrero commented 7 months ago

Hi ZexinHe, sorry to bother!.

I have a question about training with .obj files. Is this possible? or if you can give a hint on how to.

Thanks in advance!

ZexinHe commented 6 months ago

Hi there,

The input and output of OpenLRM are in the format of images. You may need to render your .obj files to images first. https://github.com/3DTopia/OpenLRM?tab=readme-ov-file#data-preparation

da2r-20 commented 6 months ago

Replace this function in the blender script under scripts

# load the glb model
def load_object(object_path: str) -> None:
    """Loads a glb model into the scene."""
    if object_path.suffix == ".glb":
        bpy.ops.import_scene.gltf(filepath=str(object_path), merge_vertices=True)
    elif object_path.suffix == ".fbx":
        bpy.ops.import_scene.fbx(filepath=str(object_path))
    elif object_path.suffix == ".obj":
        bpy.ops.import_scene.obj(filepath=str(object_path))
    else:
        raise ValueError(f"Unsupported file type: {object_path}")