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 @@
"author": "justadudewhohacks",
"license": "MIT",
"dependencies": {
"@tensorflow/tfjs-core": "1.0.3",
"tfjs-image-recognition-base": "^0.6.0",
"tslib": "^1.9.3"
"@tensorflow/tfjs-core": "1.2.2",
"tfjs-image-recognition-base": "^0.6.1",
"tslib": "^1.10.0"
},
"devDependencies": {
"@tensorflow/tfjs-node": "^1.0.2",
"@types/jasmine": "^3.3.12",
"@types/node": "^11.12.0",
"canvas": "2.0.1",
"jasmine": "^3.3.1",
"jasmine-core": "^3.3.0",
"karma": "^4.0.1",
"@tensorflow/tfjs-node": "^1.2.3",
"@types/jasmine": "^3.3.13",
"@types/node": "^12.0.10",
"canvas": "2.5.0",
"jasmine": "^3.4.0",
"jasmine-core": "^3.4.0",
"karma": "^4.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-jasmine": "^2.0.1",
"karma-typescript": "^4.0.0",
"rollup": "^1.7.3",
"rollup-plugin-commonjs": "^9.2.2",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-typescript2": "^0.20.1",
"karma-typescript": "^4.1.0",
"rollup": "^1.16.2",
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^5.1.0",
"rollup-plugin-typescript2": "^0.21.2",
"rollup-plugin-uglify": "^6.0.2",
"ts-node": "^8.0.3",
"typescript": "^3.3.4000"
"ts-node": "^8.3.0",
"typescript": "^3.5.2"
}
}
......@@ -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 genders = ['female', 'male', 'male', 'female', 'male', 'female']
function expectAgesAndGender(results: WithAge<WithGender<WithFaceDetection<{}>>>[], aligned = true) {
sortByFaceDetection(results).forEach((result, i) => {
const { age, gender, genderProbability } = result
const expectedAge = aligned ? ages[i] : agesUnaligned[i]
expect(Math.abs(age - expectedAge)).toBeLessThanOrEqual(6)
expect(gender).toEqual(genders[i])
......
......@@ -93,8 +93,8 @@ export async function assembleExpectedFullFaceDescriptions(
detections: IRect[],
landmarksFile: string = 'facesFaceLandmarkPositions.json'
): Promise<ExpectedFullFaceDescription[]> {
const landmarks = await loadJson(`test/data/${landmarksFile}`)
const descriptors = await loadJson('test/data/facesFaceDescriptors.json')
const landmarks = await loadJson<any[]>(`test/data/${landmarksFile}`)
const descriptors = await loadJson<any[]>('test/data/facesFaceDescriptors.json')
return detections.map((detection, i) => ({
detection,
......@@ -139,7 +139,13 @@ export type DescribeWithNetsOptions = {
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) {
......@@ -154,13 +160,13 @@ export function describeWithBackend(description: string, specDefinitions: () =>
describe(description, () => {
beforeAll(() => {
tf.ENV.registerBackend(newBackendName, () => backend)
tf.registerBackend(newBackendName, () => backend)
tf.setBackend(newBackendName)
})
afterAll(() => {
tf.setBackend(defaultBackendName)
tf.ENV.removeBackend(newBackendName)
tf.removeBackend(newBackendName)
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