rebuild types
parent
4719b81587
commit
697b265337
|
@ -6,7 +6,7 @@
|
|||
"output": "build.log"
|
||||
},
|
||||
"profiles": {
|
||||
"production": ["compile", "typedoc", "lint", "changelog"],
|
||||
"production": ["compile", "typings", "typedoc", "lint", "changelog"],
|
||||
"development": ["serve", "watch", "compile"]
|
||||
},
|
||||
"clean": {
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
## Changelog
|
||||
|
||||
### **HEAD -> master** 2024/01/17 mandic00@live.com
|
||||
|
||||
|
||||
### **1.7.13** 2024/01/17 mandic00@live.com
|
||||
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -22,8 +22,9 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "node --no-warnings demo/node.js",
|
||||
"dev": "build --profile development",
|
||||
"build": "node build.js",
|
||||
"dev": "build --profile development",
|
||||
"typings": "build --profile typings",
|
||||
"lint": "eslint src/ demo/",
|
||||
"test": "node --trace-warnings test/test-node.js",
|
||||
"scan": "npx auditjs@latest ossi --dev --quiet"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/// <reference path="../src/types/webgpu.d.ts" />
|
||||
/// <reference types="node" />
|
||||
|
||||
declare const add: typeof add_;
|
||||
|
||||
|
@ -1221,7 +1222,7 @@ export declare function extractFaces(input: TNetInput, detections: Array<FaceDet
|
|||
*/
|
||||
export declare function extractFaceTensors(imageTensor: tf.Tensor3D | tf.Tensor4D, detections: Array<FaceDetection | Rect>): Promise<tf.Tensor3D[]>;
|
||||
|
||||
export declare const FACE_EXPRESSION_LABELS: string[];
|
||||
export declare const FACE_EXPRESSION_LABELS: readonly ["neutral", "happy", "sad", "angry", "fearful", "disgusted", "surprised"];
|
||||
|
||||
export declare class FaceDetection extends ObjectDetection implements IFaceDetecion {
|
||||
constructor(score: number, relativeBox: Rect, imageDims: IDimensions);
|
||||
|
@ -1239,7 +1240,7 @@ export declare class FaceExpressionNet extends FaceProcessor<FaceFeatureExtracto
|
|||
constructor(faceFeatureExtractor?: FaceFeatureExtractor);
|
||||
forwardInput(input: NetInput | tf.Tensor4D): tf.Tensor2D;
|
||||
forward(input: TNetInput): Promise<tf.Tensor2D>;
|
||||
predictExpressions(input: TNetInput): Promise<any>;
|
||||
predictExpressions(input: TNetInput): Promise<FaceExpressions | FaceExpressions[]>;
|
||||
protected getDefaultModelName(): string;
|
||||
protected getClassifierChannelsIn(): number;
|
||||
protected getClassifierChannelsOut(): number;
|
||||
|
@ -1255,7 +1256,7 @@ export declare class FaceExpressions {
|
|||
surprised: number;
|
||||
constructor(probabilities: number[] | Float32Array);
|
||||
asSortedArray(): {
|
||||
expression: string;
|
||||
expression: "neutral" | "happy" | "sad" | "angry" | "fearful" | "disgusted" | "surprised";
|
||||
probability: number;
|
||||
}[];
|
||||
}
|
||||
|
@ -1431,7 +1432,7 @@ export declare function fetchOrThrow(url: string, init?: RequestInit): Promise<R
|
|||
export declare function fetchVideo(uri: string): Promise<HTMLVideoElement>;
|
||||
|
||||
declare type FileSystem_2 = {
|
||||
readFile: (filePath: string) => Promise<any>;
|
||||
readFile: (filePath: string) => Promise<string | Buffer>;
|
||||
};
|
||||
export { FileSystem_2 as FileSystem }
|
||||
|
||||
|
@ -2113,6 +2114,12 @@ declare function loadWeights(manifest: WeightsManifestConfig, filePathPrefix?: s
|
|||
|
||||
export declare const locateFaces: (input: TNetInput, options: SsdMobilenetv1Options) => Promise<FaceDetection[]>;
|
||||
|
||||
declare type MainBlockParams = {
|
||||
separable_conv0: SeparableConvParams;
|
||||
separable_conv1: SeparableConvParams;
|
||||
separable_conv2: SeparableConvParams;
|
||||
};
|
||||
|
||||
export declare function matchDimensions(input: IDimensions, reference: IDimensions, useMediaDimensions?: boolean): {
|
||||
width: number;
|
||||
height: number;
|
||||
|
@ -2616,15 +2623,15 @@ export declare abstract class NeuralNetwork<TNetParams> {
|
|||
reassignParamFromPath(paramPath: string, tensor: tf.Tensor): void;
|
||||
getParamList(): {
|
||||
path: string;
|
||||
tensor: tf.Tensor;
|
||||
tensor: tf.Tensor<tf.Rank>;
|
||||
}[];
|
||||
getTrainableParams(): {
|
||||
path: string;
|
||||
tensor: tf.Tensor;
|
||||
tensor: tf.Tensor<tf.Rank>;
|
||||
}[];
|
||||
getFrozenParams(): {
|
||||
path: string;
|
||||
tensor: tf.Tensor;
|
||||
tensor: tf.Tensor<tf.Rank>;
|
||||
}[];
|
||||
variable(): void;
|
||||
freeze(): void;
|
||||
|
@ -2834,8 +2841,8 @@ export declare const predictAgeAndGender: (input: TNetInput) => Promise<AgeAndGe
|
|||
declare class PredictAgeAndGenderTaskBase<TReturn, TParentReturn> extends ComposableTask<TReturn> {
|
||||
protected parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>;
|
||||
protected input: TNetInput;
|
||||
protected extractedFaces?: any[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: any[] | undefined);
|
||||
protected extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined);
|
||||
}
|
||||
|
||||
declare class PredictAllAgeAndGenderTask<TSource extends WithFaceDetection<{}>> extends PredictAgeAndGenderTaskBase<WithAge<WithGender<TSource>>[], TSource[]> {
|
||||
|
@ -2870,8 +2877,8 @@ export declare class PredictedBox extends LabeledBox {
|
|||
declare class PredictFaceExpressionsTaskBase<TReturn, TParentReturn> extends ComposableTask<TReturn> {
|
||||
protected parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>;
|
||||
protected input: TNetInput;
|
||||
protected extractedFaces?: any[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: any[] | undefined);
|
||||
protected extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined);
|
||||
}
|
||||
|
||||
declare type PredictionLayerParams = {
|
||||
|
@ -3316,8 +3323,14 @@ declare function softmax_<T extends Tensor>(logits: T | TensorLike, dim?: number
|
|||
|
||||
export declare class SsdMobilenetv1 extends NeuralNetwork<NetParams_4> {
|
||||
constructor();
|
||||
forwardInput(input: NetInput): any;
|
||||
forward(input: TNetInput): Promise<any>;
|
||||
forwardInput(input: NetInput): {
|
||||
boxes: tf.Tensor2D[];
|
||||
scores: tf.Tensor1D[];
|
||||
};
|
||||
forward(input: TNetInput): Promise<{
|
||||
boxes: tf.Tensor2D[];
|
||||
scores: tf.Tensor1D[];
|
||||
}>;
|
||||
locateFaces(input: TNetInput, options?: ISsdMobilenetv1Options): Promise<FaceDetection[]>;
|
||||
protected getDefaultModelName(): string;
|
||||
protected extractParamsFromWeightMap(weightMap: tf.NamedTensorMap): {
|
||||
|
@ -4116,7 +4129,7 @@ declare type TinyXceptionParams = {
|
|||
reduction_block_0: ReductionBlockParams;
|
||||
reduction_block_1: ReductionBlockParams;
|
||||
};
|
||||
middle_flow: any;
|
||||
middle_flow: Record<`main_block_${number}`, MainBlockParams>;
|
||||
exit_flow: {
|
||||
reduction_block: ReductionBlockParams;
|
||||
separable_conv: SeparableConvParams;
|
||||
|
@ -4165,7 +4178,7 @@ declare class TinyYolov2Base extends NeuralNetwork<TinyYolov2NetParams> {
|
|||
params: TinyYolov2NetParams;
|
||||
paramMappings: ParamMapping[];
|
||||
};
|
||||
protected extractBoxes(outputTensor: tf.Tensor4D, inputBlobDimensions: Dimensions, scoreThreshold?: number): Promise<any>;
|
||||
protected extractBoxes(outputTensor: tf.Tensor4D, inputBlobDimensions: Dimensions, scoreThreshold?: number): Promise<TinyYolov2ExtractBoxesResult[]>;
|
||||
private extractPredictedClass;
|
||||
}
|
||||
|
||||
|
@ -4180,6 +4193,16 @@ export declare type TinyYolov2Config = {
|
|||
isFirstLayerConv2d?: boolean;
|
||||
};
|
||||
|
||||
export declare type TinyYolov2ExtractBoxesResult = {
|
||||
box: BoundingBox;
|
||||
score: number;
|
||||
classScore: number;
|
||||
label: number;
|
||||
row: number;
|
||||
col: number;
|
||||
anchor: number;
|
||||
};
|
||||
|
||||
export declare type TinyYolov2NetParams = DefaultTinyYolov2NetParams | MobilenetParams;
|
||||
|
||||
export declare class TinyYolov2Options {
|
||||
|
|
|
@ -12,15 +12,15 @@ export declare abstract class NeuralNetwork<TNetParams> {
|
|||
reassignParamFromPath(paramPath: string, tensor: tf.Tensor): void;
|
||||
getParamList(): {
|
||||
path: string;
|
||||
tensor: tf.Tensor;
|
||||
tensor: tf.Tensor<tf.Rank>;
|
||||
}[];
|
||||
getTrainableParams(): {
|
||||
path: string;
|
||||
tensor: tf.Tensor;
|
||||
tensor: tf.Tensor<tf.Rank>;
|
||||
}[];
|
||||
getFrozenParams(): {
|
||||
path: string;
|
||||
tensor: tf.Tensor;
|
||||
tensor: tf.Tensor<tf.Rank>;
|
||||
}[];
|
||||
variable(): void;
|
||||
freeze(): void;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/// <reference types="node" />
|
||||
export type FileSystem = {
|
||||
readFile: (filePath: string) => Promise<any>;
|
||||
readFile: (filePath: string) => Promise<string | Buffer>;
|
||||
};
|
||||
export type Environment = FileSystem & {
|
||||
Canvas: typeof HTMLCanvasElement;
|
||||
|
|
|
@ -3,11 +3,12 @@ import { NetInput, TNetInput } from '../dom/index';
|
|||
import { FaceFeatureExtractor } from '../faceFeatureExtractor/FaceFeatureExtractor';
|
||||
import { FaceFeatureExtractorParams } from '../faceFeatureExtractor/types';
|
||||
import { FaceProcessor } from '../faceProcessor/FaceProcessor';
|
||||
import { FaceExpressions } from './FaceExpressions';
|
||||
export declare class FaceExpressionNet extends FaceProcessor<FaceFeatureExtractorParams> {
|
||||
constructor(faceFeatureExtractor?: FaceFeatureExtractor);
|
||||
forwardInput(input: NetInput | tf.Tensor4D): tf.Tensor2D;
|
||||
forward(input: TNetInput): Promise<tf.Tensor2D>;
|
||||
predictExpressions(input: TNetInput): Promise<any>;
|
||||
predictExpressions(input: TNetInput): Promise<FaceExpressions | FaceExpressions[]>;
|
||||
protected getDefaultModelName(): string;
|
||||
protected getClassifierChannelsIn(): number;
|
||||
protected getClassifierChannelsOut(): number;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export declare const FACE_EXPRESSION_LABELS: string[];
|
||||
export declare const FACE_EXPRESSION_LABELS: readonly ["neutral", "happy", "sad", "angry", "fearful", "disgusted", "surprised"];
|
||||
export declare class FaceExpressions {
|
||||
neutral: number;
|
||||
happy: number;
|
||||
|
@ -9,7 +9,7 @@ export declare class FaceExpressions {
|
|||
surprised: number;
|
||||
constructor(probabilities: number[] | Float32Array);
|
||||
asSortedArray(): {
|
||||
expression: string;
|
||||
expression: "neutral" | "happy" | "sad" | "angry" | "fearful" | "disgusted" | "surprised";
|
||||
probability: number;
|
||||
}[];
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { TNetInput } from '../dom/index';
|
||||
import { WithAge } from '../factories/WithAge';
|
||||
import { WithFaceDetection } from '../factories/WithFaceDetection';
|
||||
|
@ -9,8 +10,8 @@ import { PredictAllFaceExpressionsTask, PredictAllFaceExpressionsWithFaceAlignme
|
|||
export declare class PredictAgeAndGenderTaskBase<TReturn, TParentReturn> extends ComposableTask<TReturn> {
|
||||
protected parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>;
|
||||
protected input: TNetInput;
|
||||
protected extractedFaces?: any[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: any[] | undefined);
|
||||
protected extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined);
|
||||
}
|
||||
export declare class PredictAllAgeAndGenderTask<TSource extends WithFaceDetection<{}>> extends PredictAgeAndGenderTaskBase<WithAge<WithGender<TSource>>[], TSource[]> {
|
||||
run(): Promise<WithAge<WithGender<TSource>>[]>;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { TNetInput } from '../dom/index';
|
||||
import { WithFaceDetection } from '../factories/WithFaceDetection';
|
||||
import { WithFaceExpressions } from '../factories/WithFaceExpressions';
|
||||
|
@ -8,8 +9,8 @@ import { PredictAllAgeAndGenderTask, PredictAllAgeAndGenderWithFaceAlignmentTask
|
|||
export declare class PredictFaceExpressionsTaskBase<TReturn, TParentReturn> extends ComposableTask<TReturn> {
|
||||
protected parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>;
|
||||
protected input: TNetInput;
|
||||
protected extractedFaces?: any[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: any[] | undefined);
|
||||
protected extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined;
|
||||
constructor(parentTask: ComposableTask<TParentReturn> | Promise<TParentReturn>, input: TNetInput, extractedFaces?: (tf.Tensor3D | HTMLCanvasElement)[] | undefined);
|
||||
}
|
||||
export declare class PredictAllFaceExpressionsTask<TSource extends WithFaceDetection<{}>> extends PredictFaceExpressionsTaskBase<WithFaceExpressions<TSource>[], TSource[]> {
|
||||
run(): Promise<WithFaceExpressions<TSource>[]>;
|
||||
|
|
|
@ -6,8 +6,14 @@ import { ISsdMobilenetv1Options } from './SsdMobilenetv1Options';
|
|||
import { NetParams } from './types';
|
||||
export declare class SsdMobilenetv1 extends NeuralNetwork<NetParams> {
|
||||
constructor();
|
||||
forwardInput(input: NetInput): any;
|
||||
forward(input: TNetInput): Promise<any>;
|
||||
forwardInput(input: NetInput): {
|
||||
boxes: tf.Tensor2D[];
|
||||
scores: tf.Tensor1D[];
|
||||
};
|
||||
forward(input: TNetInput): Promise<{
|
||||
boxes: tf.Tensor2D[];
|
||||
scores: tf.Tensor1D[];
|
||||
}>;
|
||||
locateFaces(input: TNetInput, options?: ISsdMobilenetv1Options): Promise<FaceDetection[]>;
|
||||
protected getDefaultModelName(): string;
|
||||
protected extractParamsFromWeightMap(weightMap: tf.NamedTensorMap): {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { BoxPredictionParams } from './types';
|
||||
export declare function boxPredictionLayer(x: tf.Tensor4D, params: BoxPredictionParams): any;
|
||||
export declare function boxPredictionLayer(x: tf.Tensor4D, params: BoxPredictionParams): {
|
||||
boxPredictionEncoding: tf.Tensor<tf.Rank>;
|
||||
classPrediction: tf.Tensor<tf.Rank>;
|
||||
};
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { MobileNetV1 } from './types';
|
||||
export declare function mobileNetV1(x: tf.Tensor4D, params: MobileNetV1.Params): any;
|
||||
export declare function mobileNetV1(x: tf.Tensor4D, params: MobileNetV1.Params): {
|
||||
out: tf.Tensor4D;
|
||||
conv11: any;
|
||||
};
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { OutputLayerParams } from './types';
|
||||
export declare function outputLayer(boxPredictions: tf.Tensor4D, classPredictions: tf.Tensor4D, params: OutputLayerParams): any;
|
||||
export declare function outputLayer(boxPredictions: tf.Tensor4D, classPredictions: tf.Tensor4D, params: OutputLayerParams): {
|
||||
boxes: tf.Tensor2D[];
|
||||
scores: tf.Tensor1D[];
|
||||
};
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { PointwiseConvParams } from './types';
|
||||
export declare function pointwiseConvLayer(x: tf.Tensor4D, params: PointwiseConvParams, strides: [number, number]): any;
|
||||
export declare function pointwiseConvLayer(x: tf.Tensor4D, params: PointwiseConvParams, strides: [number, number]): tf.Tensor4D;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { PredictionLayerParams } from './types';
|
||||
export declare function predictionLayer(x: tf.Tensor4D, conv11: tf.Tensor4D, params: PredictionLayerParams): any;
|
||||
export declare function predictionLayer(x: tf.Tensor4D, conv11: tf.Tensor4D, params: PredictionLayerParams): {
|
||||
boxPredictions: tf.Tensor4D;
|
||||
classPredictions: tf.Tensor4D;
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ import { TNetInput } from '../dom/types';
|
|||
import { NeuralNetwork } from '../NeuralNetwork';
|
||||
import { TinyYolov2Config } from './config';
|
||||
import { ITinyYolov2Options } from './TinyYolov2Options';
|
||||
import { DefaultTinyYolov2NetParams, MobilenetParams, TinyYolov2NetParams } from './types';
|
||||
import { DefaultTinyYolov2NetParams, MobilenetParams, TinyYolov2ExtractBoxesResult, TinyYolov2NetParams } from './types';
|
||||
export declare class TinyYolov2Base extends NeuralNetwork<TinyYolov2NetParams> {
|
||||
static DEFAULT_FILTER_SIZES: number[];
|
||||
private _config;
|
||||
|
@ -28,6 +28,6 @@ export declare class TinyYolov2Base extends NeuralNetwork<TinyYolov2NetParams> {
|
|||
params: TinyYolov2NetParams;
|
||||
paramMappings: import("../common/types").ParamMapping[];
|
||||
};
|
||||
protected extractBoxes(outputTensor: tf.Tensor4D, inputBlobDimensions: Dimensions, scoreThreshold?: number): Promise<any>;
|
||||
protected extractBoxes(outputTensor: tf.Tensor4D, inputBlobDimensions: Dimensions, scoreThreshold?: number): Promise<TinyYolov2ExtractBoxesResult[]>;
|
||||
private extractPredictedClass;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import * as tf from '../../dist/tfjs.esm';
|
||||
import { BoundingBox } from '../classes';
|
||||
import { ConvParams } from '../common/index';
|
||||
import { SeparableConvParams } from '../common/types';
|
||||
export type BatchNorm = {
|
||||
|
@ -32,3 +33,12 @@ export type DefaultTinyYolov2NetParams = {
|
|||
conv8: ConvParams;
|
||||
};
|
||||
export type TinyYolov2NetParams = DefaultTinyYolov2NetParams | MobilenetParams;
|
||||
export type TinyYolov2ExtractBoxesResult = {
|
||||
box: BoundingBox;
|
||||
score: number;
|
||||
classScore: number;
|
||||
label: number;
|
||||
row: number;
|
||||
col: number;
|
||||
anchor: number;
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ export type TinyXceptionParams = {
|
|||
reduction_block_0: ReductionBlockParams;
|
||||
reduction_block_1: ReductionBlockParams;
|
||||
};
|
||||
middle_flow: any;
|
||||
middle_flow: Record<`main_block_${number}`, MainBlockParams>;
|
||||
exit_flow: {
|
||||
reduction_block: ReductionBlockParams;
|
||||
separable_conv: SeparableConvParams;
|
||||
|
|
Loading…
Reference in New Issue