deepinsight/insightface · error · ValueError
Identity folder root not found: {root}
Error message
Identity folder root not found: {root} What it means
_identity_dirs verifies the dataset root before scanning identity folders for verification/identification evaluation: if the path doesn't exist or isn't a directory, it raises ValueError immediately. This guards against silently evaluating an empty dataset (every downstream caller — _collect_verification_specs, _collect_identification_specs, the gallery/probe splitters — starts here).
Source
Thrown at python-package/insightface/gui/core/evaluation.py:108
if len(negatives) < max(20, int(1 / max(target_far, 1e-9))):
return "insufficient data"
thresholds = sorted({float(row["similarity"]) for row in rows if row.get("similarity") is not None}, reverse=True)
best_tar = 0.0
for threshold in thresholds:
far = sum(1 for row in negatives if row["similarity"] >= threshold) / max(1, len(negatives))
if far <= target_far:
tar = sum(1 for row in positives if row["similarity"] >= threshold) / max(1, len(positives))
best_tar = max(best_tar, tar)
return best_tar
def _identity_name(folder: Path) -> str:
return folder.name
def _identity_dirs(root: Path) -> List[Path]:
if not root.exists() or not root.is_dir():
raise ValueError(f"Identity folder root not found: {root}")
return sorted(path for path in root.iterdir() if path.is_dir())
def _auto_split_identity_images(identity_dir: Path) -> tuple[Path | None, List[Path]]:
images = sorted(list_images(identity_dir, recursive=True))
if not images:
return None, []
gallery_candidates = [path for path in images if "gallery" in path.stem.lower()]
gallery = sorted(gallery_candidates or images)[0]
probes = [path for path in images if path != gallery]
return gallery, probes
def _normalize_multi_face_policy(policy: str) -> str:
policy = (policy or MULTI_FACE_REQUIRE_ONE).strip()
return policy if policy in MULTI_FACE_POLICIES else MULTI_FACE_REQUIRE_ONE
View on GitHub (pinned to 7fadd420c2)
Solutions
- Check Path(root).is_dir() before invoking and print Path(root).resolve() to catch CWD-relative surprises.
- Verify the dataset actually downloaded/mounted and pass an absolute path.
- Fix the typo in the root argument (compare with the dataset's actual directory name).
Example fix
# before
run_identity_verification_evaluation(Path('bins/lfw'), ...) # ValueError: Identity folder root not found: bins/lfw
# after
from pathlib import Path
root = Path('bins/lfw').expanduser().resolve()
assert root.is_dir(), f'missing dataset at {root}'
run_identity_verification_evaluation(root, ...) Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
root = Path(root).expanduser().resolve()
if not root.is_dir():
raise SystemExit(f'dataset root missing: {root}') Type guard
def is_dataset_root(p) -> bool:
from pathlib import Path
p = Path(p)
return p.is_dir() and any(x.is_dir() for x in p.iterdir()) Try / catch
try:
run_identity_verification_evaluation(root, ...)
except ValueError as e:
if 'Identity folder root not found' in str(e):
# fix/download path then retry
...
raise Prevention
- Resolve dataset paths to absolute form at CLI parse time.
- Fail fast on missing dataset dirs before long job setup.
When it happens
Trigger: Calling run_identity_verification_evaluation or any _collect_* helper with a root Path that is misspelled, points to a file, or hasn't been downloaded/mounted yet.
Common situations: Wrong --root CLI argument; running evaluation before downloading the dataset; relative path resolved against a different CWD; symlink to an unmounted network share.
Related errors
- No verification pairs could be generated from the selected i
- Dataset root not found: {root}
- HERR_INVALID_PARAM
- HERR_INVALID_IMAGE_STREAM_PARAM
- HERR_INVALID_FACE_FEATURE
AI-assisted analysis of deepinsight/insightface@7fadd420c2 (2026-08-28).
Data as JSON: /api/errors/1609957c36e01242.
Report an issue: GitHub.