mirror of https://github.com/vladmandic/human
fix(gear): ensure gear.modelPath is used for loadModel()
parent
d23e824610
commit
d0bacd5028
|
@ -66,6 +66,12 @@ export interface FaceAntiSpoofConfig extends GenericConfig {}
|
|||
/** Liveness part of face configuration */
|
||||
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 */
|
||||
export interface FaceConfig extends GenericConfig {
|
||||
detector: Partial<FaceDetectorConfig>,
|
||||
|
@ -76,6 +82,7 @@ export interface FaceConfig extends GenericConfig {
|
|||
emotion: Partial<FaceEmotionConfig>,
|
||||
antispoof: Partial<FaceAntiSpoofConfig>,
|
||||
liveness: Partial<FaceLivenessConfig>,
|
||||
gear: Partial<FaceGearConfig>,
|
||||
}
|
||||
|
||||
/** 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
|
||||
export async function load(config: Config) {
|
||||
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']);
|
||||
return model;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue