Say where the face models were looked for when they are not found
Benchmarks / CPU and I/O (per commit) (push) Successful in 3m27s
Benchmarks / Frame budget (on demand) (push) Skipped
Build and test / Desktop (Linux) (push) Successful in 1h35m10s
Build and test / Layer separation (push) Successful in 39s
🐳 Android image / Build and push (push) Successful in 4s
Build and test / android-image (push) Successful in 4s
🐳 Windows image / Build and push (push) Successful in 7m11s
Build and test / windows-image (push) Successful in 7m12s
Traceability / Requirement traces (push) Successful in 58s
Build and test / Android (aarch64) (push) Successful in 24m57s
Build and test / Windows (x86_64, cross) (push) Failing after 57m30s
Benchmarks / CPU and I/O (per commit) (push) Successful in 3m27s
Benchmarks / Frame budget (on demand) (push) Skipped
Build and test / Desktop (Linux) (push) Successful in 1h35m10s
Build and test / Layer separation (push) Successful in 39s
🐳 Android image / Build and push (push) Successful in 4s
Build and test / android-image (push) Successful in 4s
🐳 Windows image / Build and push (push) Successful in 7m11s
Build and test / windows-image (push) Successful in 7m12s
Traceability / Requirement traces (push) Successful in 58s
Build and test / Android (aarch64) (push) Successful in 24m57s
Build and test / Windows (x86_64, cross) (push) Failing after 57m30s
"The chosen detector is not installed" was the whole of what a user saw, on a machine where the files were three directories away from where the lookup went. The search order was in a doc comment and nowhere a user could read it. Now a missing pair logs the detector file it wanted and every directory it tried, which is what the first Windows install needed and what the next misplaced download will.
This commit is contained in:
+20
-4
@@ -4651,14 +4651,30 @@ pub fn face_models(
|
||||
account: &Account,
|
||||
detector: dr_types::FaceDetector,
|
||||
) -> Option<(PathBuf, PathBuf)> {
|
||||
let pair = |dir: PathBuf| {
|
||||
let pair = |dir: &PathBuf| {
|
||||
let detector = dir.join(detector.file_name());
|
||||
let embedder = dir.join("arcface_mbf_b1.onnx");
|
||||
(detector.is_file() && embedder.is_file()).then_some((detector, embedder))
|
||||
};
|
||||
pair(face_models_dir(account))
|
||||
.or_else(|| pair(shared_face_models_dir()))
|
||||
.or_else(|| system_face_models_dirs().into_iter().find_map(pair))
|
||||
let mut searched = vec![face_models_dir(account), shared_face_models_dir()];
|
||||
searched.extend(system_face_models_dirs());
|
||||
let found = searched.iter().find_map(pair);
|
||||
if found.is_none() {
|
||||
// The settings page can only say "not installed". This is the line
|
||||
// that says where it looked, which is the whole of what a user with
|
||||
// the files in the wrong place needs — and the first thing to read
|
||||
// when a freshly installed package reports no model.
|
||||
log::warn!(
|
||||
"face models: no directory holds both {} and arcface_mbf_b1.onnx; searched {}",
|
||||
detector.file_name(),
|
||||
searched
|
||||
.iter()
|
||||
.map(|d| d.display().to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
);
|
||||
}
|
||||
found
|
||||
}
|
||||
|
||||
/// The scene model, its vocabulary and its category descriptor, if all three
|
||||
|
||||
Reference in New Issue
Block a user