fix(backproject): Fix mesh resimply error by adding mesh.triangulate(). (#45)

This commit is contained in:
Xinjie 2025-10-01 13:11:08 +08:00 committed by GitHub
parent 9bde39204d
commit 6a750a37be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 3 deletions

View File

@ -403,6 +403,7 @@ class MeshFixer(object):
) )
mesh.clean(inplace=True) mesh.clean(inplace=True)
mesh.clear_data() mesh.clear_data()
mesh = mesh.triangulate()
mesh = mesh.decimate(ratio, progress_bar=True) mesh = mesh.decimate(ratio, progress_bar=True)
# Update vertices and faces # Update vertices and faces

View File

@ -81,6 +81,7 @@ LAYOUT_DISASSEMBLE_PROMPT = f"""
- Containers that hold objects (e.g., "bowl of apples", "box of tools") must - Containers that hold objects (e.g., "bowl of apples", "box of tools") must
be separated into individual items (e.g., ["bowl", "apple1", "apple2"]). be separated into individual items (e.g., ["bowl", "apple1", "apple2"]).
- Do not include transparent objects such as "glass", "plastic", etc. - Do not include transparent objects such as "glass", "plastic", etc.
- All {Scene3DItemEnum.MANIPULATED_OBJS} and {Scene3DItemEnum.DISTRACTOR_OBJS} must be child node of {Scene3DItemEnum.CONTEXT}.
- The output must be in compact JSON format and use Markdown syntax, just like the output in the example below. - The output must be in compact JSON format and use Markdown syntax, just like the output in the example below.
Examples: Examples:

View File

@ -118,6 +118,16 @@ def entrypoint() -> None:
match_key = SCENE_MATCHER.query( match_key = SCENE_MATCHER.query(
text, str(scene_dict), params=gpt_params text, str(scene_dict), params=gpt_params
) )
n_max_attempt = 10
while match_key not in scene_dict and n_max_attempt > 0:
logger.error(
f"Cannot find matched scene {match_key}, retrying left {n_max_attempt}..."
)
match_key = SCENE_MATCHER.query(
text, str(scene_dict), params=gpt_params
)
n_max_attempt -= 1
match_scene_path = f"{os.path.dirname(args.bg_list)}/{match_key}" match_scene_path = f"{os.path.dirname(args.bg_list)}/{match_key}"
bg_save_dir = os.path.join(output_root, "background") bg_save_dir = os.path.join(output_root, "background")
copytree(match_scene_path, bg_save_dir, dirs_exist_ok=True) copytree(match_scene_path, bg_save_dir, dirs_exist_ok=True)

View File

@ -513,21 +513,23 @@ class SemanticMatcher(BaseChecker):
- If there are fewer than <return_num> distinct relevant matches, repeat the closest ones to make a list of <return_num>. - If there are fewer than <return_num> distinct relevant matches, repeat the closest ones to make a list of <return_num>.
- Only output the list of <return_num> scene IDs, sorted from most to less similar. - Only output the list of <return_num> scene IDs, sorted from most to less similar.
- Do NOT use markdown, JSON code blocks, or any formatting syntax, only return a plain list like ["id1", ...]. - Do NOT use markdown, JSON code blocks, or any formatting syntax, only return a plain list like ["id1", ...].
- The returned scene ID must exist in the dictionary and be in exactly the same format. For example,
if the key in the dictionary is "scene_0040", return "scene_0040"; if it is "scene_040", return "scene_040".
Input example: Input example:
Dictionary: Dictionary:
"{{ "{{
"t_scene_008": "A study room with full bookshelves and a lamp in the corner.", "t_scene_0008": "A study room with full bookshelves and a lamp in the corner.",
"t_scene_019": "A child's bedroom with pink walls and a small desk.", "t_scene_019": "A child's bedroom with pink walls and a small desk.",
"t_scene_020": "A living room with a wooden floor.", "t_scene_020": "A living room with a wooden floor.",
"t_scene_021": "A living room with toys scattered on the floor.", "t_scene_021": "A living room with toys scattered on the floor.",
... ...
"t_scene_office_001": "A very spacious, modern open-plan office with wide desks and no people, panoramic view." "t_scene_office_0001": "A very spacious, modern open-plan office with wide desks and no people, panoramic view."
}}" }}"
Text: Text:
"A traditional indoor room" "A traditional indoor room"
Output: Output:
'["t_scene_office_001", ...]' '["t_scene_office_0001", ...]'
Input: Input:
Dictionary: Dictionary: