Generalize scene camera profiles
This commit is contained in:
@@ -548,6 +548,28 @@ def smoke_row_camera_policy() -> None:
|
||||
"coworking lounge frame with the couple near a desk edge" in updated.get("composition", ""),
|
||||
"row camera policy did not adapt coworking composition for couple rows",
|
||||
)
|
||||
library_row = {
|
||||
"prompt": "A generated adult prompt. Composition: vertical polished mirror view with bag and shoes visible. Avoid: low quality.",
|
||||
"caption": "sxcppnl7, generated adult prompt, polished mirror view with bag and shoes visible, illustration",
|
||||
"scene_text": "grand classical library hall with towering dark-wood bookshelves, carved columns, rolling ladders, marble floor, and warm brass lamps",
|
||||
"composition": "polished mirror view with bag and shoes visible",
|
||||
"subject_type": "woman",
|
||||
"women_count": 1,
|
||||
"men_count": 0,
|
||||
}
|
||||
updated_library = row_camera.apply_camera_config(
|
||||
library_row,
|
||||
_orbit_camera(horizontal_angle=315, vertical_angle=0, zoom=5.0),
|
||||
compact_labels=pb.CAMERA_COMPACT_LABELS,
|
||||
)
|
||||
library_scene = _expect_text("row_camera_policy.library_scene", updated_library.get("camera_scene_directive"), 40)
|
||||
library_composition = _expect_text("row_camera_policy.library_composition", updated_library.get("composition"), 20)
|
||||
_expect("Library camera layout" in library_scene, "row camera policy missed library layout")
|
||||
_expect("front-left quarter view" in library_scene, "row camera library layout missed orbit direction")
|
||||
_expect("bookshelf" in library_scene.lower() or "bookshelves" in library_scene.lower(), "row camera library layout missed shelf anchors")
|
||||
_expect("bag" not in library_composition.lower(), "row camera library composition leaked bag wording")
|
||||
_expect("shoes" not in library_composition.lower(), "row camera library composition leaked shoes wording")
|
||||
_expect("library" in library_composition.lower(), "row camera library composition did not become location-aware")
|
||||
|
||||
|
||||
def smoke_config_route_location_theme() -> None:
|
||||
@@ -588,8 +610,12 @@ def smoke_config_route_location_theme() -> None:
|
||||
scene = _expect_text("config_route_location_theme.scene_text", row.get("scene_text"), 20)
|
||||
composition = _expect_text("config_route_location_theme.composition", row.get("composition"), 10)
|
||||
camera = _expect_text("config_route_location_theme.camera_directive", row.get("camera_directive"), 20)
|
||||
scene_directive = _expect_text("config_route_location_theme.camera_scene_directive", row.get("camera_scene_directive"), 40)
|
||||
_expect("library" in scene.lower() or "bookshelves" in scene.lower(), "location theme did not drive scene")
|
||||
_expect("books" in composition.lower() or "shelf" in composition.lower() or "library" in composition.lower(), "location theme did not drive composition")
|
||||
_expect("Library camera layout" in scene_directive, "location theme did not drive library camera-scene adapter")
|
||||
_expect("front-left quarter view" in scene_directive, "library camera-scene adapter missed orbit direction")
|
||||
_expect("bag" not in composition.lower() and "shoes" not in composition.lower(), "location theme composition leaked outfit-check props")
|
||||
_expect("315-degree front-left quarter view" in camera, "config route did not preserve orbit camera directive")
|
||||
seed_config = row.get("seed_config") if isinstance(row.get("seed_config"), dict) else {}
|
||||
_expect(seed_config.get("pose_seed") == 3302, "seed lock did not reroll pose axis")
|
||||
@@ -608,6 +634,7 @@ def smoke_config_route_location_theme() -> None:
|
||||
krea = krea_formatter.format_krea2_prompt("", metadata_json=_json(row), target="single")
|
||||
prompt = krea.get("krea_prompt") or ""
|
||||
_expect("library" in prompt.lower() or "bookshelves" in prompt.lower(), "Krea config route lost theme scene")
|
||||
_expect("Library camera layout" in prompt, "Krea config route lost library camera-scene directive")
|
||||
_expect("315-degree front-left quarter view" in prompt, "Krea config route lost camera directive")
|
||||
_expect_formatter_outputs(row, "config_route_location_theme", target="single")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user