Skip to content

Commit cb52dab

Browse files
Merge pull request justadudewhohacks#504 from justadudewhohacks/remove-tfjs-image-recognition-base
remove tfjs image recognition base
2 parents c804dc6 + 0b4470a commit cb52dab

File tree

198 files changed

+3923
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+3923
-466
lines changed

examples/examples-browser/public/js/faceDetectionControls.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ function getFaceDetectorOptions() {
2626
}
2727

2828
function onIncreaseMinConfidence() {
29-
minConfidence = Math.min(faceapi.round(minConfidence + 0.1), 1.0)
29+
minConfidence = Math.min(faceapi.utils.round(minConfidence + 0.1), 1.0)
3030
$('#minConfidence').val(minConfidence)
3131
updateResults()
3232
}
3333

3434
function onDecreaseMinConfidence() {
35-
minConfidence = Math.max(faceapi.round(minConfidence - 0.1), 0.1)
35+
minConfidence = Math.max(faceapi.utils.round(minConfidence - 0.1), 0.1)
3636
$('#minConfidence').val(minConfidence)
3737
updateResults()
3838
}
@@ -51,24 +51,24 @@ function changeInputSize(size) {
5151
}
5252

5353
function onIncreaseScoreThreshold() {
54-
scoreThreshold = Math.min(faceapi.round(scoreThreshold + 0.1), 1.0)
54+
scoreThreshold = Math.min(faceapi.utils.round(scoreThreshold + 0.1), 1.0)
5555
$('#scoreThreshold').val(scoreThreshold)
5656
updateResults()
5757
}
5858

5959
function onDecreaseScoreThreshold() {
60-
scoreThreshold = Math.max(faceapi.round(scoreThreshold - 0.1), 0.1)
60+
scoreThreshold = Math.max(faceapi.utils.round(scoreThreshold - 0.1), 0.1)
6161
$('#scoreThreshold').val(scoreThreshold)
6262
updateResults()
6363
}
6464

6565
function onIncreaseMinFaceSize() {
66-
minFaceSize = Math.min(faceapi.round(minFaceSize + 20), 300)
66+
minFaceSize = Math.min(faceapi.utils.round(minFaceSize + 20), 300)
6767
$('#minFaceSize').val(minFaceSize)
6868
}
6969

7070
function onDecreaseMinFaceSize() {
71-
minFaceSize = Math.max(faceapi.round(minFaceSize - 20), 50)
71+
minFaceSize = Math.max(faceapi.utils.round(minFaceSize - 20), 50)
7272
$('#minFaceSize').val(minFaceSize)
7373
}
7474

examples/examples-browser/views/ageAndGenderRecognition.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@
161161
const { age, gender, genderProbability } = result
162162
new faceapi.draw.DrawTextField(
163163
[
164-
`${faceapi.round(age, 0)} years`,
165-
`${gender} (${faceapi.round(genderProbability)})`
164+
`${faceapi.utils.round(age, 0)} years`,
165+
`${gender} (${faceapi.utils.round(genderProbability)})`
166166
],
167167
result.detection.box.bottomLeft
168168
).draw(canvas)

examples/examples-browser/views/bbtFaceMatching.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696

9797
function displayTimeStats(timeInMs) {
9898
$('#time').val(`${timeInMs} ms`)
99-
$('#fps').val(`${faceapi.round(1000 / timeInMs)}`)
99+
$('#fps').val(`${faceapi.utils.round(1000 / timeInMs)}`)
100100
}
101101

102102
function displayImage(src) {

examples/examples-browser/views/bbtFaceSimilarity.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
let descriptors = { desc1: null, desc2: null }
4040

4141
function updateResult() {
42-
const distance = faceapi.round(
42+
const distance = faceapi.utils.round(
4343
faceapi.euclideanDistance(descriptors.desc1, descriptors.desc2)
4444
)
4545
let text = distance

examples/examples-browser/views/videoFaceTracking.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
forwardTimes = [timeInMs].concat(forwardTimes).slice(0, 30)
157157
const avgTimeInMs = forwardTimes.reduce((total, t) => total + t) / forwardTimes.length
158158
$('#time').val(`${Math.round(avgTimeInMs)} ms`)
159-
$('#fps').val(`${faceapi.round(1000 / avgTimeInMs)}`)
159+
$('#fps').val(`${faceapi.utils.round(1000 / avgTimeInMs)}`)
160160
}
161161

162162
async function onPlay(videoEl) {

examples/examples-browser/views/webcamAgeAndGenderRecognition.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
forwardTimes = [timeInMs].concat(forwardTimes).slice(0, 30)
153153
const avgTimeInMs = forwardTimes.reduce((total, t) => total + t) / forwardTimes.length
154154
$('#time').val(`${Math.round(avgTimeInMs)} ms`)
155-
$('#fps').val(`${faceapi.round(1000 / avgTimeInMs)}`)
155+
$('#fps').val(`${faceapi.utils.round(1000 / avgTimeInMs)}`)
156156
}
157157

158158
function interpolateAgePredictions(age) {
@@ -192,8 +192,8 @@
192192
const interpolatedAge = interpolateAgePredictions(age)
193193
new faceapi.draw.DrawTextField(
194194
[
195-
`${faceapi.round(interpolatedAge, 0)} years`,
196-
`${gender} (${faceapi.round(genderProbability)})`
195+
`${faceapi.utils.round(interpolatedAge, 0)} years`,
196+
`${gender} (${faceapi.utils.round(genderProbability)})`
197197
],
198198
result.detection.box.bottomLeft
199199
).draw(canvas)

examples/examples-browser/views/webcamFaceDetection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
forwardTimes = [timeInMs].concat(forwardTimes).slice(0, 30)
140140
const avgTimeInMs = forwardTimes.reduce((total, t) => total + t) / forwardTimes.length
141141
$('#time').val(`${Math.round(avgTimeInMs)} ms`)
142-
$('#fps').val(`${faceapi.round(1000 / avgTimeInMs)}`)
142+
$('#fps').val(`${faceapi.utils.round(1000 / avgTimeInMs)}`)
143143
}
144144

145145
async function onPlay() {

examples/examples-browser/views/webcamFaceExpressionRecognition.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
forwardTimes = [timeInMs].concat(forwardTimes).slice(0, 30)
152152
const avgTimeInMs = forwardTimes.reduce((total, t) => total + t) / forwardTimes.length
153153
$('#time').val(`${Math.round(avgTimeInMs)} ms`)
154-
$('#fps').val(`${faceapi.round(1000 / avgTimeInMs)}`)
154+
$('#fps').val(`${faceapi.utils.round(1000 / avgTimeInMs)}`)
155155
}
156156

157157
async function onPlay() {

examples/examples-browser/views/webcamFaceLandmarkDetection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
forwardTimes = [timeInMs].concat(forwardTimes).slice(0, 30)
152152
const avgTimeInMs = forwardTimes.reduce((total, t) => total + t) / forwardTimes.length
153153
$('#time').val(`${Math.round(avgTimeInMs)} ms`)
154-
$('#fps').val(`${faceapi.round(1000 / avgTimeInMs)}`)
154+
$('#fps').val(`${faceapi.utils.round(1000 / avgTimeInMs)}`)
155155
}
156156

157157
async function onPlay() {

examples/examples-nodejs/ageAndGenderRecognition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ async function run() {
1919
const { age, gender, genderProbability } = result
2020
new faceapi.draw.DrawTextField(
2121
[
22-
`${faceapi.round(age, 0)} years`,
23-
`${gender} (${faceapi.round(genderProbability)})`
22+
`${faceapi.utils.round(age, 0)} years`,
23+
`${gender} (${faceapi.utils.round(genderProbability)})`
2424
],
2525
result.detection.box.bottomLeft
2626
).draw(out)

jasmine-node.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
let spec_files = ['**/*.test.ts'].concat(
2-
process.env.EXCLUDE_UNCOMPRESSED
3-
? ['!**/*.uncompressed.test.ts']
4-
: []
5-
)
1+
let spec_files = ['**/*.test.ts']
62

73
// exclude browser tests
84
spec_files = spec_files.concat(['!**/*.browser.test.ts'])
5+
spec_files = spec_files.concat(['!test/tests.legacy/*'])
96

107
module.exports = {
118
spec_dir: 'test',

karma.conf.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const dataFiles = [
22
'test/images/*.jpg',
33
'test/images/*.png',
44
'test/data/*.json',
5+
'test/data/*.weights',
56
'test/media/*.mp4',
67
'weights/**/*',
78
'weights_uncompressed/**/*',
@@ -21,24 +22,17 @@ let exclude = (
2122
'faceLandmarkNet',
2223
'faceRecognitionNet',
2324
'ssdMobilenetv1',
24-
'tinyFaceDetector',
25-
'mtcnn'
25+
'tinyFaceDetector'
2626
]
2727
: []
2828
)
2929
.filter(ex => ex !== process.env.UUT)
3030
.map(ex => `test/tests/${ex}/*.ts`)
3131

32-
33-
exclude = exclude.concat(
34-
process.env.EXCLUDE_UNCOMPRESSED
35-
? ['**/*.uncompressed.test.ts']
36-
: []
37-
)
38-
3932
// exclude nodejs tests
4033
exclude = exclude.concat(['**/*.node.test.ts'])
4134
exclude = exclude.concat(['test/env.node.ts'])
35+
exclude = exclude.concat(['test/tests-legacy/**/*.ts'])
4236

4337

4438
module.exports = function(config) {

package-lock.json

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

package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,16 @@
1111
"tsc": "tsc",
1212
"tsc-es6": "tsc --p tsconfig.es6.json",
1313
"build": "rm -rf ./build && rm -rf ./dist && npm run rollup && npm run rollup-min && npm run tsc && npm run tsc-es6",
14-
"test": "karma start",
14+
"test": "npm run test-browser && npm run test-node",
1515
"test-browser": "karma start --single-run",
1616
"test-node": "ts-node -r ./test/env.node.ts node_modules/jasmine/bin/jasmine --config=jasmine-node.js",
17-
"test-all": "npm run test-browser-exclude-uncompressed && npm run test-node-exclude-uncompressed",
18-
"test-all-include-uncompressed": "npm run test-browser && npm run test-node",
1917
"test-facelandmarknets": "set UUT=faceLandmarkNet&& karma start",
2018
"test-facerecognitionnet": "set UUT=faceRecognitionNet&& karma start",
2119
"test-agegendernet": "set UUT=ageGenderNet&& karma start",
2220
"test-ssdmobilenetv1": "set UUT=ssdMobilenetv1&& karma start",
2321
"test-tinyfacedetector": "set UUT=tinyFaceDetector&& karma start",
2422
"test-globalapi": "set UUT=globalApi&& karma start",
25-
"test-mtcnn": "set UUT=mtcnn&& karma start",
2623
"test-cpu": "set BACKEND_CPU=true&& karma start",
27-
"test-exclude-uncompressed": "set EXCLUDE_UNCOMPRESSED=true&& karma start",
28-
"test-browser-exclude-uncompressed": "set EXCLUDE_UNCOMPRESSED=true&& karma start --single-run",
29-
"test-node-exclude-uncompressed": "set EXCLUDE_UNCOMPRESSED=true&& npm run test-node",
3024
"docs": "typedoc --options ./typedoc.config.js ./src"
3125
},
3226
"keywords": [
@@ -40,7 +34,6 @@
4034
"license": "MIT",
4135
"dependencies": {
4236
"@tensorflow/tfjs-core": "1.2.9",
43-
"tfjs-image-recognition-base": "^0.6.2",
4437
"tslib": "^1.10.0"
4538
},
4639
"devDependencies": {

0 commit comments

Comments
 (0)