deepinsight/insightface · error · ValueError
1:N evaluation requires at least one known probe image.
Error message
1:N evaluation requires at least one known probe image.
What it means
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.
Source
Thrown at python-package/insightface/gui/core/evaluation.py:840
def run_identity_identification_evaluation(
dataset_root: str | Path,
engine: FaceEngine,
auto_split: bool = False,
multi_face_policy: str = MULTI_FACE_REQUIRE_ONE,
license_status: str = DEFAULT_LICENSE_STATUS,
progress_callback=None,
cancel_callback=None,
) -> EvaluationResult:
root = Path(dataset_root).expanduser()
if not root.is_dir():
raise ValueError(f"Dataset root not found: {root}")
gallery_items, probe_items, unknown_items = (
_collect_gallery_probe_auto_split(root) if auto_split else _collect_gallery_probe_structured(root)
)
if not gallery_items:
raise ValueError("1:N evaluation requires at least one gallery image.")
if not probe_items:
raise ValueError("1:N evaluation requires at least one known probe image.")
errors: List[Dict[str, Any]] = []
cache: Dict[str, np.ndarray] = {}
gallery: List[Dict[str, Any]] = []
start_all = time.perf_counter()
for index, item in enumerate(gallery_items):
embedding = _embedding_for_image(
Path(item["path"]),
engine,
cache,
errors,
"gallery",
multi_face_policy=multi_face_policy,
)
if embedding is not None:
gallery.append({"identity": item["identity"], "path": str(item["path"]), "embedding": embedding})
if progress_callback:
progress_callback(index + 1, len(gallery_items), f"Indexed gallery {index + 1}/{len(gallery_items)}")View on GitHub (pinned to 7fadd420c2)
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
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
EXTS = {".jpg", ".jpeg", ".png", ".bmp"}
probe_dir = Path(root) / "probe"
n = sum(1 for f in probe_dir.rglob("*") if f.suffix.lower() in EXTS)
assert n > 0, "no known probes" Try / catch
try:
result = run_identity_identification_evaluation(root, auto_split=False)
except ValueError as e:
if "at least one known probe" in str(e):
add_probe_images() Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- 1:N evaluation requires at least one gallery image.
- No verification pairs could be generated from the selected i
- 1:N without Auto Split requires gallery/ and probe/ folders.
- Dataset root not found: {root}
- Identity folder root not found: {root}
AI-assisted analysis of deepinsight/insightface@7fadd420c2 (2026-08-28).
Data as JSON: /api/errors/a5a2fe544f4d18af.
Report an issue: GitHub.