Commit 3db2825a by vincent

bump tfjs-core to 1.2.2 + bump dev dependencies

parent 2e4f5995
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -39,27 +39,27 @@ ...@@ -39,27 +39,27 @@
"author": "justadudewhohacks", "author": "justadudewhohacks",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@tensorflow/tfjs-core": "1.0.3", "@tensorflow/tfjs-core": "1.2.2",
"tfjs-image-recognition-base": "^0.6.0", "tfjs-image-recognition-base": "^0.6.1",
"tslib": "^1.9.3" "tslib": "^1.10.0"
}, },
"devDependencies": { "devDependencies": {
"@tensorflow/tfjs-node": "^1.0.2", "@tensorflow/tfjs-node": "^1.2.3",
"@types/jasmine": "^3.3.12", "@types/jasmine": "^3.3.13",
"@types/node": "^11.12.0", "@types/node": "^12.0.10",
"canvas": "2.0.1", "canvas": "2.5.0",
"jasmine": "^3.3.1", "jasmine": "^3.4.0",
"jasmine-core": "^3.3.0", "jasmine-core": "^3.4.0",
"karma": "^4.0.1", "karma": "^4.1.0",
"karma-chrome-launcher": "^2.2.0", "karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^2.0.1", "karma-jasmine": "^2.0.1",
"karma-typescript": "^4.0.0", "karma-typescript": "^4.1.0",
"rollup": "^1.7.3", "rollup": "^1.16.2",
"rollup-plugin-commonjs": "^9.2.2", "rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^4.0.1", "rollup-plugin-node-resolve": "^5.1.0",
"rollup-plugin-typescript2": "^0.20.1", "rollup-plugin-typescript2": "^0.21.2",
"rollup-plugin-uglify": "^6.0.2", "rollup-plugin-uglify": "^6.0.2",
"ts-node": "^8.0.3", "ts-node": "^8.3.0",
"typescript": "^3.3.4000" "typescript": "^3.5.2"
} }
} }
...@@ -29,14 +29,13 @@ function expectFaceExpressions(results: WithFaceExpressions<WithFaceDetection<{} ...@@ -29,14 +29,13 @@ function expectFaceExpressions(results: WithFaceExpressions<WithFaceDetection<{}
}) })
} }
const ages = [34, 27, 41, 26, 31, 37] const ages = [34, 27, 41, 26, 31, 40]
const agesUnaligned = [33, 26, 37, 30, 36, 22] const agesUnaligned = [33, 26, 37, 30, 36, 22]
const genders = ['female', 'male', 'male', 'female', 'male', 'female'] const genders = ['female', 'male', 'male', 'female', 'male', 'female']
function expectAgesAndGender(results: WithAge<WithGender<WithFaceDetection<{}>>>[], aligned = true) { function expectAgesAndGender(results: WithAge<WithGender<WithFaceDetection<{}>>>[], aligned = true) {
sortByFaceDetection(results).forEach((result, i) => { sortByFaceDetection(results).forEach((result, i) => {
const { age, gender, genderProbability } = result const { age, gender, genderProbability } = result
const expectedAge = aligned ? ages[i] : agesUnaligned[i] const expectedAge = aligned ? ages[i] : agesUnaligned[i]
expect(Math.abs(age - expectedAge)).toBeLessThanOrEqual(6) expect(Math.abs(age - expectedAge)).toBeLessThanOrEqual(6)
expect(gender).toEqual(genders[i]) expect(gender).toEqual(genders[i])
......
...@@ -93,8 +93,8 @@ export async function assembleExpectedFullFaceDescriptions( ...@@ -93,8 +93,8 @@ export async function assembleExpectedFullFaceDescriptions(
detections: IRect[], detections: IRect[],
landmarksFile: string = 'facesFaceLandmarkPositions.json' landmarksFile: string = 'facesFaceLandmarkPositions.json'
): Promise<ExpectedFullFaceDescription[]> { ): Promise<ExpectedFullFaceDescription[]> {
const landmarks = await loadJson(`test/data/${landmarksFile}`) const landmarks = await loadJson<any[]>(`test/data/${landmarksFile}`)
const descriptors = await loadJson('test/data/facesFaceDescriptors.json') const descriptors = await loadJson<any[]>('test/data/facesFaceDescriptors.json')
return detections.map((detection, i) => ({ return detections.map((detection, i) => ({
detection, detection,
...@@ -139,7 +139,13 @@ export type DescribeWithNetsOptions = { ...@@ -139,7 +139,13 @@ export type DescribeWithNetsOptions = {
withTinyYolov2?: WithTinyYolov2Options withTinyYolov2?: WithTinyYolov2Options
} }
const gpgpu = tf.ENV.backend['gpgpu'] const gpgpu = tf.backend()['gpgpu']
if (gpgpu) {
console.log('running tests on WebGL backend')
} else {
console.log('running tests on CPU backend')
}
export function describeWithBackend(description: string, specDefinitions: () => void) { export function describeWithBackend(description: string, specDefinitions: () => void) {
...@@ -154,13 +160,13 @@ export function describeWithBackend(description: string, specDefinitions: () => ...@@ -154,13 +160,13 @@ export function describeWithBackend(description: string, specDefinitions: () =>
describe(description, () => { describe(description, () => {
beforeAll(() => { beforeAll(() => {
tf.ENV.registerBackend(newBackendName, () => backend) tf.registerBackend(newBackendName, () => backend)
tf.setBackend(newBackendName) tf.setBackend(newBackendName)
}) })
afterAll(() => { afterAll(() => {
tf.setBackend(defaultBackendName) tf.setBackend(defaultBackendName)
tf.ENV.removeBackend(newBackendName) tf.removeBackend(newBackendName)
backend.dispose() backend.dispose()
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment