{"record":{"id":"a5a2fe544f4d18af","repo":"deepinsight/insightface","slug":"1-n-evaluation-requires-at-least-one-known-probe-i","errorCode":null,"errorMessage":"1:N evaluation requires at least one known probe image.","messagePattern":"1:N evaluation requires at least one known probe image\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python-package/insightface/gui/core/evaluation.py","lineNumber":840,"sourceCode":"def run_identity_identification_evaluation(\n    dataset_root: str | Path,\n    engine: FaceEngine,\n    auto_split: bool = False,\n    multi_face_policy: str = MULTI_FACE_REQUIRE_ONE,\n    license_status: str = DEFAULT_LICENSE_STATUS,\n    progress_callback=None,\n    cancel_callback=None,\n) -> EvaluationResult:\n    root = Path(dataset_root).expanduser()\n    if not root.is_dir():\n        raise ValueError(f\"Dataset root not found: {root}\")\n    gallery_items, probe_items, unknown_items = (\n        _collect_gallery_probe_auto_split(root) if auto_split else _collect_gallery_probe_structured(root)\n    )\n    if not gallery_items:\n        raise ValueError(\"1:N evaluation requires at least one gallery image.\")\n    if not probe_items:\n        raise ValueError(\"1:N evaluation requires at least one known probe image.\")\n\n    errors: List[Dict[str, Any]] = []\n    cache: Dict[str, np.ndarray] = {}\n    gallery: List[Dict[str, Any]] = []\n    start_all = time.perf_counter()\n    for index, item in enumerate(gallery_items):\n        embedding = _embedding_for_image(\n            Path(item[\"path\"]),\n            engine,\n            cache,\n            errors,\n            \"gallery\",\n            multi_face_policy=multi_face_policy,\n        )\n        if embedding is not None:\n            gallery.append({\"identity\": item[\"identity\"], \"path\": str(item[\"path\"]), \"embedding\": embedding})\n        if progress_callback:\n            progress_callback(index + 1, len(gallery_items), f\"Indexed gallery {index + 1}/{len(gallery_items)}\")","sourceCodeStart":822,"sourceCodeEnd":858,"githubUrl":"https://github.com/deepinsight/insightface/blob/7fadd420c2351d0ffa8cac403421c1a3ed733365/python-package/insightface/gui/core/evaluation.py#L822-L858","documentation":"Raised by run_identity_identification_evaluation when no known probe images were collected (probe_items is empty). Probes with known identity are required to compute top-1/top-N accuracy; without them the evaluation has no ground truth to score.","triggerScenarios":"Structured mode: probe/ folder missing (caught earlier if gallery also missing) or empty of images. Auto-split: too few images per identity so nothing is allocated to the probe split.","commonSituations":"probe folder present but images filtered out (wrong extensions, corrupt files); auto_split ratio leaving all images in gallery; misnamed probe directory; test fixture forgetting probe images.","solutions":["Ensure probe/<identity>/ folders contain at least one valid image each","For auto_split, provide enough images per identity so the probe split is non-empty","Verify image extensions match what list_images accepts","Inspect collected counts before running by debugging _collect_gallery_probe_* output"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\nEXTS = {\".jpg\", \".jpeg\", \".png\", \".bmp\"}\nprobe_dir = Path(root) / \"probe\"\nn = sum(1 for f in probe_dir.rglob(\"*\") if f.suffix.lower() in EXTS)\nassert n > 0, \"no known probes\"","typeGuard":null,"tryCatchPattern":"try:\n    result = run_identity_identification_evaluation(root, auto_split=False)\nexcept ValueError as e:\n    if \"at least one known probe\" in str(e):\n        add_probe_images()","preventionTips":["Ensure probe folders have labeled images per identity","With auto_split, keep >=2 images per identity so probe split is non-empty","Preflight-count probe images like gallery images"],"tags":["insightface","probe","dataset","identification"],"backgroundTag":"empty-probe-dataset","analyzedSha":"7fadd420c2351d0ffa8cac403421c1a3ed733365","analyzedAt":"2026-08-28T15:44:01.850Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}