OpenLRM icon indicating copy to clipboard operation
OpenLRM copied to clipboard

Training with .obj files

Open juanfraherrero opened this issue 10 months ago • 2 comments

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!

juanfraherrero avatar Apr 15 '24 01:04 juanfraherrero

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

ZexinHe avatar May 06 '24 10:05 ZexinHe

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}")

da2r-20 avatar May 26 '24 19:05 da2r-20