bert_simpson / forgebench /code /ours /mv-sam3d_local.diff
Ronaldo-GOAT's picture
forgebench: add missing local modules (RVG infer.py, gt_loader, faithfulness), MV-SAM3D diff, pinned commits
e4e030b verified
Raw History Blame Contribute Delete
4.1 kB
diff --git a/run_inference.py b/run_inference.py
index 96f93e3..2b9401a 100644
--- a/run_inference.py
+++ b/run_inference.py
@@ -140,6 +140,7 @@ def run_inference(
attention_stage: Optional[str] = None,
attention_layers: Optional[List[int]] = None,
save_coords: bool = False,
+ mesh_postprocess: bool = False,
):
"""
Run inference
@@ -223,7 +224,7 @@ def run_inference(
mask,
seed=seed,
stage1_only=False,
- with_mesh_postprocess=False,
+ with_mesh_postprocess=mesh_postprocess,
with_texture_baking=False,
use_vertex_color=True,
stage1_inference_steps=stage1_steps,
@@ -241,7 +242,7 @@ def run_inference(
stage1_inference_steps=stage1_steps,
stage2_inference_steps=stage2_steps,
decode_formats=decode_formats,
- with_mesh_postprocess=False,
+ with_mesh_postprocess=mesh_postprocess,
with_texture_baking=False,
use_vertex_color=True,
attention_logger=attention_logger,
@@ -387,7 +388,13 @@ Examples:
action="store_true",
help="Save 3D spatial coordinates in SLAT attention files (default: False)",
)
-
+ parser.add_argument(
+ "--mesh-postprocess",
+ dest="mesh_postprocess",
+ action="store_true",
+ help="Enable mesh postprocessing (simplify=0.95, fill holes). Default: False (dense mesh).",
+ )
+
args = parser.parse_args()
input_path = Path(args.input_path)
@@ -414,6 +421,7 @@ Examples:
attention_stage=args.attention_stage,
attention_layers=parse_attention_layers(args.attention_layers),
save_coords=args.save_coords,
+ mesh_postprocess=args.mesh_postprocess,
)
except Exception as e:
logger.error(f"Inference failed: {e}")
diff --git a/run_inference_weighted.py b/run_inference_weighted.py
index ef9ca36..cfe968e 100644
--- a/run_inference_weighted.py
+++ b/run_inference_weighted.py
@@ -2548,6 +2548,7 @@ def run_weighted_inference(
pose_opt_mask_erosion: int = 3,
pose_opt_device: str = "cuda",
pose_opt_optimize_scale: bool = False,
+ mesh_postprocess: bool = False,
):
"""
Run weighted inference with adaptive multi-view fusion.
@@ -2939,7 +2940,7 @@ def run_weighted_inference(
mask,
seed=seed,
stage1_only=False,
- with_mesh_postprocess=False,
+ with_mesh_postprocess=mesh_postprocess,
with_texture_baking=False,
use_vertex_color=True,
stage1_inference_steps=stage1_steps,
@@ -2988,7 +2989,7 @@ def run_weighted_inference(
stage1_inference_steps=stage1_steps,
stage2_inference_steps=stage2_steps,
decode_formats=decode_formats,
- with_mesh_postprocess=False,
+ with_mesh_postprocess=mesh_postprocess,
with_texture_baking=False,
use_vertex_color=True,
attention_logger=attention_logger,
@@ -3968,7 +3969,9 @@ Examples:
help="Pose optimization: device (cuda or cpu, default: cuda)")
parser.add_argument("--pose_opt_optimize_scale", action="store_true",
help="Pose optimization: optimize scale (default: False, only optimize rotation and translation)")
-
+ parser.add_argument("--mesh-postprocess", dest="mesh_postprocess", action="store_true",
+ help="Enable mesh postprocessing (simplify=0.95, fill holes). Default: False (dense mesh).")
+
args = parser.parse_args()
input_path = Path(args.input_path)
@@ -4077,6 +4080,7 @@ Examples:
pose_opt_mask_erosion=args.pose_opt_mask_erosion,
pose_opt_device=args.pose_opt_device,
pose_opt_optimize_scale=args.pose_opt_optimize_scale,
+ mesh_postprocess=args.mesh_postprocess,
)
except Exception as e:
logger.error(f"Inference failed: {e}")