forgebench: add missing local modules (RVG infer.py, gt_loader, faithfulness), MV-SAM3D diff, pinned commits
e4e030b verified Download forgebench/code/ours/mv-sam3d_local.diff from Ronaldo-GOAT/bert_simpson: direct link, hf CLI and curl.
- Browser
- Download file 4.1 kB
-
https://huggingface.co/Ronaldo-GOAT/bert_simpson/resolve/main/forgebench/code/ours/mv-sam3d_local.diff
- Command line
-
hf download hf://Ronaldo-GOAT/bert_simpson/forgebench/code/ours/mv-sam3d_local.diff
-
curl -L -o mv-sam3d_local.diff https://huggingface.co/Ronaldo-GOAT/bert_simpson/resolve/main/forgebench/code/ours/mv-sam3d_local.diff
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 | |
| def run_inference( | |
| attention_stage: Optional[str] = None, | |
| attention_layers: Optional[List[int]] = None, | |
| save_coords: bool = False, | |
| + mesh_postprocess: bool = False, | |
| ): | |
| """ | |
| Run inference | |
| 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, | |
| 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, | |
| 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) | |
| 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 | |
| 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. | |
| 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, | |
| 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, | |
| 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) | |
| 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}") | |