Initial commit: scene-actor-extraction pipeline

Source (KPN++ pipeline nodes, ArcFace embedders, SCRFD/YuNet detectors,
gallery builder), build scripts, and eval artifacts.

- external/KPN as a git submodule (gitea.tourolle.paris/dtourolle/KPN)
- ONNX models tracked via Git LFS (models/*.onnx)
- generated outputs, TensorRT engines, reference repos, and media ignored
This commit is contained in:
2026-06-12 15:29:01 +02:00
commit d753062c6c
50 changed files with 10100 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
#pragma once
#include "types.hpp"
#include <string>
// Build an ActorGallery from a directory tree:
//
// gallery_root/
// nm0000093_Brad_Pitt/
// img1.jpg
// img2.jpg
// ...
// nm0000129_Cate_Blanchett/
// ...
//
// Each subdirectory name is parsed as "<imdb_id>_<Name_With_Underscores>".
// For every image:
// 1. Detect face with SCRFD-500MF (expect exactly one; warn and skip if 0 or >1).
// 2. Align with ArcFace 5-point transform → 112×112 crop.
// 3. Embed with ArcFace ONNX → 512-dim L2-normalised embedding.
// All embeddings are stored (best-of-N match at query time).
//
// Returns a gallery ready to pass to save_gallery() / IdentityMatcherFunc.
struct BuildConfig {
std::string gallery_root; // directory tree described above
std::string detector_model;
std::string arcface_model;
float detector_conf{0.5f};
float detector_nms{0.4f};
int max_side{500}; // downscale source images to this max dimension
// before detection — TMDB portraits are ~2k px,
// SCRFD trains on smaller faces and detection
// confidence drops on huge inputs. 0 = disabled.
};
ActorGallery build_gallery(const BuildConfig& cfg);