Skip to main content

installed_model_dir

Function installed_model_dir 

Source
pub fn installed_model_dir(executable: &Path, subdir: &str) -> Option<PathBuf>
Expand description

Model directory for subdir of an installed application, derived from its executable only: the resources directory rightkit_onnx::installed_resource_dir names, joined with subdir. It returns the candidate without checking that it exists. None for a relative executable path, or when subdir is not exactly one plain name (empty, an absolute path, .., . or a nested path such as a/b).

Layouts, from the executable: macOS Foo.app/Contents/MacOS/foo gives Foo.app/Contents/Resources/<subdir>; Windows gives <exe dir>/<subdir>; elsewhere <exe dir>/resources/<subdir>. Ship a model beside the app in that place, or pass a directory the caller resolved itself to EmbedderConfig::new.