Add normal camera atlas catalog
This commit is contained in:
@@ -6862,6 +6862,102 @@ def smoke_krea2_pov_pose_variant_catalog() -> None:
|
||||
_expect(required_keys.issubset(seen_keys), "Krea2 POV pose-variant catalog lost a proven starter variant")
|
||||
|
||||
|
||||
def smoke_normal_camera_atlas_catalog() -> None:
|
||||
atlas_path = ROOT / "categories" / "normal_camera_atlas.json"
|
||||
variants_path = ROOT / "categories" / "normal_camera_variants.json"
|
||||
doc_path = ROOT / "docs" / "normal-camera-atlas.md"
|
||||
_expect(atlas_path.is_file(), "Normal camera atlas inventory is missing")
|
||||
_expect(variants_path.is_file(), "Normal camera variant catalog is missing")
|
||||
_expect(doc_path.is_file(), "Normal camera atlas docs are missing")
|
||||
|
||||
atlas = json.loads(atlas_path.read_text(encoding="utf-8"))
|
||||
variants_catalog = json.loads(variants_path.read_text(encoding="utf-8"))
|
||||
_expect(atlas.get("version") == 1, "Normal camera atlas inventory version changed unexpectedly")
|
||||
_expect(variants_catalog.get("version") == 1, "Normal camera variant catalog version changed unexpectedly")
|
||||
_expect_text("normal_camera_atlas.atlas_root", atlas.get("atlas_root"), 20)
|
||||
atlas_scope = atlas.get("scope") if isinstance(atlas.get("scope"), dict) else {}
|
||||
variant_scope = variants_catalog.get("scope") if isinstance(variants_catalog.get("scope"), dict) else {}
|
||||
_expect("non-POV" in atlas_scope.get("included", ""), "Normal camera atlas scope lost non-POV inclusion note")
|
||||
_expect(
|
||||
"No generator defaults" in atlas_scope.get("generator_behavior", ""),
|
||||
"Normal camera atlas scope should stay behavior-neutral",
|
||||
)
|
||||
_expect(
|
||||
"Pre-A/B only" in variant_scope.get("testing_state", ""),
|
||||
"Normal camera variant catalog should stay pre-A/B only",
|
||||
)
|
||||
|
||||
folders = atlas.get("folders")
|
||||
variants = variants_catalog.get("variants")
|
||||
_expect(isinstance(folders, list) and len(folders) == 104, "Normal camera atlas should track 104 folders")
|
||||
_expect(isinstance(variants, list) and len(variants) == 86, "Normal camera variant catalog should track 86 variants")
|
||||
inventory = atlas.get("inventory") or {}
|
||||
_expect(inventory.get("jpg_count") == 1979, "Normal camera atlas lost reference image count")
|
||||
_expect(inventory.get("catalog_status_counts", {}).get("camera_reference") == 49, "Normal camera atlas lost camera-reference count")
|
||||
variant_inventory = variants_catalog.get("inventory") or {}
|
||||
_expect(variant_inventory.get("status_counts", {}).get("pre_ab_candidate") == 35, "Normal camera variants lost pre-A/B count")
|
||||
_expect(variant_inventory.get("status_counts", {}).get("needs_samples") == 51, "Normal camera variants lost needs-samples count")
|
||||
|
||||
folder_keys: set[str] = set()
|
||||
folder_names: set[str] = set()
|
||||
camera_views = set((atlas.get("camera_view_values") or {}).keys())
|
||||
action_families = set((atlas.get("action_family_values") or {}).keys())
|
||||
catalog_statuses = set((atlas.get("catalog_status_values") or {}).keys())
|
||||
for folder in folders:
|
||||
key = _expect_text("normal_camera_atlas.folder.key", folder.get("key"), 2)
|
||||
_expect(key not in folder_keys, f"Normal camera atlas has duplicate folder key {key!r}")
|
||||
folder_keys.add(key)
|
||||
folder_name = str(folder.get("folder") or "")
|
||||
_expect(folder_name.strip(), f"{key}.folder is empty")
|
||||
folder_names.add(folder_name)
|
||||
_expect(folder.get("camera_view") in camera_views, f"{key} has unknown camera view {folder.get('camera_view')!r}")
|
||||
_expect(folder.get("action_family") in action_families, f"{key} has unknown action family {folder.get('action_family')!r}")
|
||||
_expect(folder.get("catalog_status") in catalog_statuses, f"{key} has unknown catalog status {folder.get('catalog_status')!r}")
|
||||
for ref in folder.get("reference_images") or []:
|
||||
ref_text = str(ref or "").strip()
|
||||
_expect(ref_text, f"{key}.reference_image is empty")
|
||||
_expect(".." not in Path(ref_text).parts, f"{key} reference escapes atlas root: {ref_text!r}")
|
||||
|
||||
variant_statuses = set((variants_catalog.get("status_values") or {}).keys())
|
||||
seen_variant_keys: set[str] = set()
|
||||
required_variants = {
|
||||
"normal_doggy_all_fours_side_view",
|
||||
"normal_cowgirl_side_profile",
|
||||
"normal_missionary_side_profile",
|
||||
"normal_blowjob_laying_front_view",
|
||||
"normal_penis_worship_top_view",
|
||||
"normal_penis_worship_side_view",
|
||||
"normal_penis_worship_laying_partner_vertical_side_view",
|
||||
}
|
||||
for variant in variants:
|
||||
key = _expect_text("normal_camera_variants.key", variant.get("key"), 8)
|
||||
_expect(key not in seen_variant_keys, f"Normal camera variants have duplicate key {key!r}")
|
||||
seen_variant_keys.add(key)
|
||||
_expect(variant.get("status") in variant_statuses, f"{key} has unknown status {variant.get('status')!r}")
|
||||
_expect_text(f"{key}.canonical_geometry", variant.get("canonical_geometry"), 40)
|
||||
prompt_cues = variant.get("prompt_cues")
|
||||
avoid_cues = variant.get("avoid_cues")
|
||||
refs = variant.get("reference_images")
|
||||
_expect(isinstance(prompt_cues, list) and prompt_cues, f"{key} has no prompt cues")
|
||||
_expect(isinstance(avoid_cues, list) and avoid_cues, f"{key} has no avoid cues")
|
||||
_expect(isinstance(refs, list) and refs, f"{key} has no reference images")
|
||||
for folder_name in variant.get("atlas_folders") or []:
|
||||
_expect(folder_name in folder_names, f"{key} references unknown atlas folder {folder_name!r}")
|
||||
for ref in refs:
|
||||
ref_text = str(ref or "").strip()
|
||||
_expect(ref_text, f"{key}.reference_image is empty")
|
||||
_expect(".." not in Path(ref_text).parts, f"{key} reference escapes atlas root: {ref_text!r}")
|
||||
hook = variant.get("generator_hook") or {}
|
||||
_expect_text(f"{key}.generator_hook.notes", hook.get("notes"), 20)
|
||||
_expect("Future hook only" in hook.get("notes", ""), f"{key} should remain a future hook, not a live route")
|
||||
_expect(required_variants.issubset(seen_variant_keys), "Normal camera variants lost required reviewed camera splits")
|
||||
|
||||
doc = doc_path.read_text(encoding="utf-8")
|
||||
_expect("Normal Camera Atlas" in doc, "Normal camera docs lost title")
|
||||
_expect("Curated variants | 86" in doc, "Normal camera docs lost variant count")
|
||||
_expect("penis-worship orientation corrections" in doc, "Normal camera docs lost user-corrected orientation note")
|
||||
|
||||
|
||||
def _atlas_variant_include_key(variant_key: str) -> str:
|
||||
key = "".join(char if char.isalnum() else "_" for char in str(variant_key).lower().removeprefix("pov_")).strip("_")
|
||||
while "__" in key:
|
||||
@@ -17161,6 +17257,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("insta_pair_camera_split", smoke_insta_pair_camera_split),
|
||||
("pov_camera_scene", smoke_pov_camera_scene),
|
||||
("krea2_pov_pose_variant_catalog", smoke_krea2_pov_pose_variant_catalog),
|
||||
("normal_camera_atlas_catalog", smoke_normal_camera_atlas_catalog),
|
||||
("krea2_pov_atlas_variant_prompt_routes", smoke_krea2_pov_atlas_variant_prompt_routes),
|
||||
("krea2_pose_variant_catalog_policy", smoke_krea2_pose_variant_catalog_policy),
|
||||
("krea2_eval_log_policy", smoke_krea2_eval_log_policy),
|
||||
|
||||
Reference in New Issue
Block a user