fix(backproject): Fix mesh resimply error by adding mesh.triangulate(). (#45)
This commit is contained in:
parent
9bde39204d
commit
6a750a37be
@ -403,6 +403,7 @@ class MeshFixer(object):
|
||||
)
|
||||
mesh.clean(inplace=True)
|
||||
mesh.clear_data()
|
||||
mesh = mesh.triangulate()
|
||||
mesh = mesh.decimate(ratio, progress_bar=True)
|
||||
|
||||
# Update vertices and faces
|
||||
|
||||
@ -81,6 +81,7 @@ LAYOUT_DISASSEMBLE_PROMPT = f"""
|
||||
- Containers that hold objects (e.g., "bowl of apples", "box of tools") must
|
||||
be separated into individual items (e.g., ["bowl", "apple1", "apple2"]).
|
||||
- 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.
|
||||
|
||||
Examples:
|
||||
|
||||
@ -118,6 +118,16 @@ def entrypoint() -> None:
|
||||
match_key = SCENE_MATCHER.query(
|
||||
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}"
|
||||
bg_save_dir = os.path.join(output_root, "background")
|
||||
copytree(match_scene_path, bg_save_dir, dirs_exist_ok=True)
|
||||
|
||||
@ -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>.
|
||||
- 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", ...].
|
||||
- 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:
|
||||
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_020": "A living room with a wooden 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:
|
||||
"A traditional indoor room"
|
||||
Output:
|
||||
'["t_scene_office_001", ...]'
|
||||
'["t_scene_office_0001", ...]'
|
||||
|
||||
Input:
|
||||
Dictionary:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user