Skip to content

Commit 0b4470a

Browse files
faceapi.round -> faceapi.utils.round
1 parent 5df8e27 commit 0b4470a

10 files changed

+19
-19
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)

0 commit comments

Comments
 (0)