{"record":{"id":"de3a89b89182baa7","repo":"deepinsight/insightface","slug":"no-verification-pairs-could-be-generated-from-the","errorCode":null,"errorMessage":"No verification pairs could be generated from the selected identity folders.","messagePattern":"No verification pairs could be generated from the selected identity folders\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python-package/insightface/gui/core/evaluation.py","lineNumber":693,"sourceCode":"    else:\n        images: List[Dict[str, Any]] = []\n        for identity_dir in identities:\n            identity = _identity_name(identity_dir)\n            images.extend({\"identity\": identity, \"path\": path} for path in sorted(list_images(identity_dir, recursive=True)))\n        for left_index, left in enumerate(images):\n            for right in images[left_index + 1 :]:\n                pair_specs.append(\n                    {\n                        \"image1_path\": str(left[\"path\"]),\n                        \"image2_path\": str(right[\"path\"]),\n                        \"probe_identity\": left[\"identity\"],\n                        \"gallery_identity\": right[\"identity\"],\n                        \"label\": 1 if left[\"identity\"] == right[\"identity\"] else 0,\n                    }\n                )\n\n    if not pair_specs:\n        raise ValueError(\"No verification pairs could be generated from the selected identity folders.\")\n\n    start_all = time.perf_counter()\n    rows: List[Dict[str, Any]] = []\n    for index, spec in enumerate(pair_specs):\n        if cancel_callback and cancel_callback():\n            break\n        start = time.perf_counter()\n        row = dict(spec)\n        emb1 = _embedding_for_image(\n            Path(spec[\"image1_path\"]),\n            engine,\n            cache,\n            errors,\n            \"verification\",\n            multi_face_policy=multi_face_policy,\n        )\n        emb2 = _embedding_for_image(\n            Path(spec[\"image2_path\"]),","sourceCodeStart":675,"sourceCodeEnd":711,"githubUrl":"https://github.com/deepinsight/insightface/blob/7fadd420c2351d0ffa8cac403421c1a3ed733365/python-package/insightface/gui/core/evaluation.py#L675-L711","documentation":"Raised by run_identity_verification_evaluation when pair_specs ends up empty, i.e., no positive or negative pairs could be built from the selected identity folders. This means the folder layout/counts cannot form any same-identity or cross-identity image pairs.","triggerScenarios":"Using auto-split with fewer than 2 images per identity, or a dataset root with only one identity folder containing a single image; identity folders with no recognizable images at all.","commonSituations":"Test datasets with one photo per person; images filtered out earlier due to read/detection failures leaving too few; pointing dataset_root at the wrong directory level (folders of folders).","solutions":["Ensure each identity folder has at least 2 images (for positive pairs) and there are at least 2 identity folders (for negative pairs)","Verify dataset_root points at the directory whose immediate children are identity folders","Check that images pass validation (readable, single face) so they are not dropped before pairing","Without auto split, provide explicit gallery/probe structure so pairs can be generated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\nids = [d for d in Path(root).iterdir() if d.is_dir()]\ncounts = {d.name: len(list_images(d, recursive=True)) for d in ids}\nassert sum(1 for c in counts.values() if c >= 2) >= 1 and len(ids) >= 1, \"cannot form pairs\"","typeGuard":null,"tryCatchPattern":"try:\n    result = run_identity_verification_evaluation(root, ...)\nexcept ValueError as e:\n    if \"No verification pairs\" in str(e):\n        raise SystemExit(\"Need >=2 images in an identity and/or >=2 identities\")","preventionTips":["Require >=2 images per identity for verification datasets","Validate folder layout before launching long runs","Use auto split with sufficient images per identity"],"tags":["insightface","verification","dataset","pairing","evaluation"],"backgroundTag":"empty-dataset-pairs","analyzedSha":"7fadd420c2351d0ffa8cac403421c1a3ed733365","analyzedAt":"2026-08-28T15:44:01.850Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}