mirror of https://github.com/vladmandic/human
fix(gear): ensure gear.modelPath is used for loadModel()
parent
4f69e85e1f
commit
dce08771b4
|
@ -66,6 +66,12 @@ export interface FaceAntiSpoofConfig extends GenericConfig {}
|
||||||
/** Liveness part of face configuration */
|
/** Liveness part of face configuration */
|
||||||
export interface FaceLivenessConfig extends GenericConfig {}
|
export interface FaceLivenessConfig extends GenericConfig {}
|
||||||
|
|
||||||
|
/** Gear part of face configuration */
|
||||||
|
export interface FaceGearConfig extends GenericConfig {
|
||||||
|
/** minimum confidence for a detected race before results are discarded */
|
||||||
|
minConfidence: number,
|
||||||
|
}
|
||||||
|
|
||||||
/** Configures all face-specific options: face detection, mesh analysis, age, gender, emotion detection and face description */
|
/** Configures all face-specific options: face detection, mesh analysis, age, gender, emotion detection and face description */
|
||||||
export interface FaceConfig extends GenericConfig {
|
export interface FaceConfig extends GenericConfig {
|
||||||
detector: Partial<FaceDetectorConfig>,
|
detector: Partial<FaceDetectorConfig>,
|
||||||
|
@ -76,6 +82,7 @@ export interface FaceConfig extends GenericConfig {
|
||||||
emotion: Partial<FaceEmotionConfig>,
|
emotion: Partial<FaceEmotionConfig>,
|
||||||
antispoof: Partial<FaceAntiSpoofConfig>,
|
antispoof: Partial<FaceAntiSpoofConfig>,
|
||||||
liveness: Partial<FaceLivenessConfig>,
|
liveness: Partial<FaceLivenessConfig>,
|
||||||
|
gear: Partial<FaceGearConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Configures all body detection specific options */
|
/** Configures all body detection specific options */
|
||||||
|
|
|
@ -24,7 +24,7 @@ let skipped = Number.MAX_SAFE_INTEGER;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export async function load(config: Config) {
|
export async function load(config: Config) {
|
||||||
if (env.initial) model = null;
|
if (env.initial) model = null;
|
||||||
if (!model) model = await loadModel(config.face['gear']);
|
if (!model) model = await loadModel(config.face['gear']?.modelPath);
|
||||||
else if (config.debug) log('cached model:', model['modelUrl']);
|
else if (config.debug) log('cached model:', model['modelUrl']);
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue