facebookresearch / facebookresearch/sam-3d-objects

Where to set the layout_post_optimization_method parameter for the run() method?

Open
#63 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.4k
Forks
878
PR merge metrics
No merged PRs in 30d

Description

I'm using the run() method of the SAM 3D model (specifically the core inference interface) and noticed that it includes a parameter self.layout_post_optimization_method which controls the layout post-optimization process.

According to the code logic:
When with_layout_postprocess=True (default), the method attempts to run layout post-optimization using self.layout_post_optimization_method.
However, I cannot find any documentation, configuration options, or setter methods in the project to specify/modify this parameter.

def run(
self,
image: Union[None, Image.Image, np.ndarray],
mask: Union[None, Image.Image, np.ndarray] = None,
seed: Optional[int] = None,
stage1_only=False,
with_mesh_postprocess=True,
with_texture_baking=True,
with_layout_postprocess=True,
use_vertex_color=False,
stage1_inference_steps=None,
stage2_inference_steps=None,
use_stage1_distillation=False,
use_stage2_distillation=False,
pointmap=None,
decode_formats=None,
estimate_plane=False,
) -> dict:
#........

try:
if (
with_layout_postprocess
and self.layout_post_optimization_method is not None
):
assert glb is not None, "require mesh to run postprocessing"
logger.info("Running layout post optimization method...")
postprocessed_pose = self.run_post_optimization(
deepcopy(glb),
pointmap_dict["intrinsics"],
ss_return_dict,
ss_input_dict,
)
ss_return_dict.update(postprocessed_pose)
except Exception as e:
logger.error(
f"Error during layout post optimization: {e}", exc_info=True
)

# glb.export("sample.glb")
logger.info("Finished!")

return {
**ss_return_dict,
**outputs,
"pointmap": pts.cpu().permute((1, 2, 0)), # HxWx3
"pointmap_colors": pts_colors.cpu().permute((1, 2, 0)), # HxWx3
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.