@vladmandic/face-api
Version:
FaceAPI: AI-powered Face Detection & Rotation Tracking, Face Description & Recognition, Age & Gender & Emotion Prediction for Browser and NodeJS using TensorFlow/JS
30 lines (21 loc) • 873 B
text/typescript
export interface ISsdMobilenetv1Options {
minConfidence?: number
maxResults?: number
}
export class SsdMobilenetv1Options {
protected _name = 'SsdMobilenetv1Options'
private _minConfidence: number
private _maxResults: number
constructor({ minConfidence, maxResults }: ISsdMobilenetv1Options = {}) {
this._minConfidence = minConfidence || 0.5;
this._maxResults = maxResults || 100;
if (typeof this._minConfidence !== 'number' || this._minConfidence <= 0 || this._minConfidence >= 1) {
throw new Error(`${this._name} - expected minConfidence to be a number between 0 and 1`);
}
if (typeof this._maxResults !== 'number') {
throw new Error(`${this._name} - expected maxResults to be a number`);
}
}
get minConfidence(): number { return this._minConfidence; }
get maxResults(): number { return this._maxResults; }
}