Skip to content

Commit 16d6f4d

Browse files
committed
Removed FaceMatcher.toJSON(), updated the tests and built
1 parent 31e0027 commit 16d6f4d

File tree

14 files changed

+8
-31
lines changed

14 files changed

+8
-31
lines changed

build/commonjs/classes/LabeledFaceDescriptors.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/commonjs/globalApi/FaceMatcher.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ export declare class FaceMatcher {
1010
computeMeanDistance(queryDescriptor: Float32Array, descriptors: Float32Array[]): number;
1111
matchDescriptor(queryDescriptor: Float32Array): FaceMatch;
1212
findBestMatch(queryDescriptor: Float32Array): FaceMatch;
13-
static toJSON(matcher: FaceMatcher, pretty?: boolean): string;
1413
static fromJSON(jsonString: string): FaceMatcher;
1514
}

build/commonjs/globalApi/FaceMatcher.js

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/commonjs/globalApi/FaceMatcher.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/es6/classes/LabeledFaceDescriptors.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/es6/globalApi/FaceMatcher.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ export declare class FaceMatcher {
1010
computeMeanDistance(queryDescriptor: Float32Array, descriptors: Float32Array[]): number;
1111
matchDescriptor(queryDescriptor: Float32Array): FaceMatch;
1212
findBestMatch(queryDescriptor: Float32Array): FaceMatch;
13-
static toJSON(matcher: FaceMatcher, pretty?: boolean): string;
1413
static fromJSON(jsonString: string): FaceMatcher;
1514
}

build/es6/globalApi/FaceMatcher.js

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/es6/globalApi/FaceMatcher.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.js

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/face-api.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/classes/LabeledFaceDescriptors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export class LabeledFaceDescriptors {
1717

1818
public get label(): string { return this._label }
1919
public get descriptors(): Float32Array[] { return this._descriptors }
20+
2021
}

src/globalApi/FaceMatcher.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ export class FaceMatcher {
6767
: new FaceMatch('unknown', bestMatch.distance)
6868
}
6969

70-
public static toJSON(matcher: FaceMatcher, pretty = false): string {
71-
return JSON.stringify(matcher, null, pretty ? 2 : undefined);
72-
}
73-
7470
public static fromJSON(jsonString: string): FaceMatcher {
7571
const poco: any = JSON.parse(jsonString);
7672
const labeledDescriptors = poco._labeledDescriptors

test/tests/globalApi/FaceMatcher.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ describe('globalApi', () => {
1818
new LabeledFaceDescriptors(l2, [f3, f4])
1919
];
2020

21-
it('toJSON()', () => {
22-
const fm = new FaceMatcher(lds, dt);
23-
24-
expect(FaceMatcher.toJSON(fm)).toBe(json);
25-
});
26-
2721
it('fromJSON()', () => {
2822
const fm = FaceMatcher.fromJSON(json);
2923

@@ -40,7 +34,7 @@ describe('globalApi', () => {
4034
});
4135

4236
it('toJSON() => fromJSON()', () => {
43-
const fm = FaceMatcher.fromJSON(FaceMatcher.toJSON(new FaceMatcher(lds, dt)));
37+
const fm = FaceMatcher.fromJSON(JSON.stringify(new FaceMatcher(lds, dt)));
4438

4539
expect(fm.distanceThreshold).toBe(dt);
4640
expect(fm.labeledDescriptors.length).toBe(2);

0 commit comments

Comments
 (0)