Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
face
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
face
Commits
0b4470af
Commit
0b4470af
authored
Dec 14, 2019
by
vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faceapi.round -> faceapi.utils.round
parent
5df8e27a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
19 deletions
+19
-19
faceDetectionControls.js
examples/examples-browser/public/js/faceDetectionControls.js
+6
-6
ageAndGenderRecognition.html
examples/examples-browser/views/ageAndGenderRecognition.html
+2
-2
bbtFaceMatching.html
examples/examples-browser/views/bbtFaceMatching.html
+1
-1
bbtFaceSimilarity.html
examples/examples-browser/views/bbtFaceSimilarity.html
+1
-1
videoFaceTracking.html
examples/examples-browser/views/videoFaceTracking.html
+1
-1
webcamAgeAndGenderRecognition.html
...examples-browser/views/webcamAgeAndGenderRecognition.html
+3
-3
webcamFaceDetection.html
examples/examples-browser/views/webcamFaceDetection.html
+1
-1
webcamFaceExpressionRecognition.html
...amples-browser/views/webcamFaceExpressionRecognition.html
+1
-1
webcamFaceLandmarkDetection.html
...s/examples-browser/views/webcamFaceLandmarkDetection.html
+1
-1
ageAndGenderRecognition.ts
examples/examples-nodejs/ageAndGenderRecognition.ts
+2
-2
No files found.
examples/examples-browser/public/js/faceDetectionControls.js
View file @
0b4470af
...
...
@@ -26,13 +26,13 @@ function getFaceDetectorOptions() {
}
function
onIncreaseMinConfidence
()
{
minConfidence
=
Math
.
min
(
faceapi
.
round
(
minConfidence
+
0.1
),
1.0
)
minConfidence
=
Math
.
min
(
faceapi
.
utils
.
round
(
minConfidence
+
0.1
),
1.0
)
$
(
'#minConfidence'
).
val
(
minConfidence
)
updateResults
()
}
function
onDecreaseMinConfidence
()
{
minConfidence
=
Math
.
max
(
faceapi
.
round
(
minConfidence
-
0.1
),
0.1
)
minConfidence
=
Math
.
max
(
faceapi
.
utils
.
round
(
minConfidence
-
0.1
),
0.1
)
$
(
'#minConfidence'
).
val
(
minConfidence
)
updateResults
()
}
...
...
@@ -51,24 +51,24 @@ function changeInputSize(size) {
}
function
onIncreaseScoreThreshold
()
{
scoreThreshold
=
Math
.
min
(
faceapi
.
round
(
scoreThreshold
+
0.1
),
1.0
)
scoreThreshold
=
Math
.
min
(
faceapi
.
utils
.
round
(
scoreThreshold
+
0.1
),
1.0
)
$
(
'#scoreThreshold'
).
val
(
scoreThreshold
)
updateResults
()
}
function
onDecreaseScoreThreshold
()
{
scoreThreshold
=
Math
.
max
(
faceapi
.
round
(
scoreThreshold
-
0.1
),
0.1
)
scoreThreshold
=
Math
.
max
(
faceapi
.
utils
.
round
(
scoreThreshold
-
0.1
),
0.1
)
$
(
'#scoreThreshold'
).
val
(
scoreThreshold
)
updateResults
()
}
function
onIncreaseMinFaceSize
()
{
minFaceSize
=
Math
.
min
(
faceapi
.
round
(
minFaceSize
+
20
),
300
)
minFaceSize
=
Math
.
min
(
faceapi
.
utils
.
round
(
minFaceSize
+
20
),
300
)
$
(
'#minFaceSize'
).
val
(
minFaceSize
)
}
function
onDecreaseMinFaceSize
()
{
minFaceSize
=
Math
.
max
(
faceapi
.
round
(
minFaceSize
-
20
),
50
)
minFaceSize
=
Math
.
max
(
faceapi
.
utils
.
round
(
minFaceSize
-
20
),
50
)
$
(
'#minFaceSize'
).
val
(
minFaceSize
)
}
...
...
examples/examples-browser/views/ageAndGenderRecognition.html
View file @
0b4470af
...
...
@@ -161,8 +161,8 @@
const
{
age
,
gender
,
genderProbability
}
=
result
new
faceapi
.
draw
.
DrawTextField
(
[
`
${
faceapi
.
round
(
age
,
0
)}
years`
,
`
${
gender
}
(
${
faceapi
.
round
(
genderProbability
)}
)`
`
${
faceapi
.
utils
.
round
(
age
,
0
)}
years`
,
`
${
gender
}
(
${
faceapi
.
utils
.
round
(
genderProbability
)}
)`
],
result
.
detection
.
box
.
bottomLeft
).
draw
(
canvas
)
...
...
examples/examples-browser/views/bbtFaceMatching.html
View file @
0b4470af
...
...
@@ -96,7 +96,7 @@
function
displayTimeStats
(
timeInMs
)
{
$
(
'#time'
).
val
(
`
${
timeInMs
}
ms`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
round
(
1000
/
timeInMs
)}
`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
utils
.
round
(
1000
/
timeInMs
)}
`
)
}
function
displayImage
(
src
)
{
...
...
examples/examples-browser/views/bbtFaceSimilarity.html
View file @
0b4470af
...
...
@@ -39,7 +39,7 @@
let
descriptors
=
{
desc1
:
null
,
desc2
:
null
}
function
updateResult
()
{
const
distance
=
faceapi
.
round
(
const
distance
=
faceapi
.
utils
.
round
(
faceapi
.
euclideanDistance
(
descriptors
.
desc1
,
descriptors
.
desc2
)
)
let
text
=
distance
...
...
examples/examples-browser/views/videoFaceTracking.html
View file @
0b4470af
...
...
@@ -156,7 +156,7 @@
forwardTimes
=
[
timeInMs
].
concat
(
forwardTimes
).
slice
(
0
,
30
)
const
avgTimeInMs
=
forwardTimes
.
reduce
((
total
,
t
)
=>
total
+
t
)
/
forwardTimes
.
length
$
(
'#time'
).
val
(
`
${
Math
.
round
(
avgTimeInMs
)}
ms`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
round
(
1000
/
avgTimeInMs
)}
`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
utils
.
round
(
1000
/
avgTimeInMs
)}
`
)
}
async
function
onPlay
(
videoEl
)
{
...
...
examples/examples-browser/views/webcamAgeAndGenderRecognition.html
View file @
0b4470af
...
...
@@ -152,7 +152,7 @@
forwardTimes
=
[
timeInMs
].
concat
(
forwardTimes
).
slice
(
0
,
30
)
const
avgTimeInMs
=
forwardTimes
.
reduce
((
total
,
t
)
=>
total
+
t
)
/
forwardTimes
.
length
$
(
'#time'
).
val
(
`
${
Math
.
round
(
avgTimeInMs
)}
ms`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
round
(
1000
/
avgTimeInMs
)}
`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
utils
.
round
(
1000
/
avgTimeInMs
)}
`
)
}
function
interpolateAgePredictions
(
age
)
{
...
...
@@ -192,8 +192,8 @@
const
interpolatedAge
=
interpolateAgePredictions
(
age
)
new
faceapi
.
draw
.
DrawTextField
(
[
`
${
faceapi
.
round
(
interpolatedAge
,
0
)}
years`
,
`
${
gender
}
(
${
faceapi
.
round
(
genderProbability
)}
)`
`
${
faceapi
.
utils
.
round
(
interpolatedAge
,
0
)}
years`
,
`
${
gender
}
(
${
faceapi
.
utils
.
round
(
genderProbability
)}
)`
],
result
.
detection
.
box
.
bottomLeft
).
draw
(
canvas
)
...
...
examples/examples-browser/views/webcamFaceDetection.html
View file @
0b4470af
...
...
@@ -139,7 +139,7 @@
forwardTimes
=
[
timeInMs
].
concat
(
forwardTimes
).
slice
(
0
,
30
)
const
avgTimeInMs
=
forwardTimes
.
reduce
((
total
,
t
)
=>
total
+
t
)
/
forwardTimes
.
length
$
(
'#time'
).
val
(
`
${
Math
.
round
(
avgTimeInMs
)}
ms`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
round
(
1000
/
avgTimeInMs
)}
`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
utils
.
round
(
1000
/
avgTimeInMs
)}
`
)
}
async
function
onPlay
()
{
...
...
examples/examples-browser/views/webcamFaceExpressionRecognition.html
View file @
0b4470af
...
...
@@ -151,7 +151,7 @@
forwardTimes
=
[
timeInMs
].
concat
(
forwardTimes
).
slice
(
0
,
30
)
const
avgTimeInMs
=
forwardTimes
.
reduce
((
total
,
t
)
=>
total
+
t
)
/
forwardTimes
.
length
$
(
'#time'
).
val
(
`
${
Math
.
round
(
avgTimeInMs
)}
ms`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
round
(
1000
/
avgTimeInMs
)}
`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
utils
.
round
(
1000
/
avgTimeInMs
)}
`
)
}
async
function
onPlay
()
{
...
...
examples/examples-browser/views/webcamFaceLandmarkDetection.html
View file @
0b4470af
...
...
@@ -151,7 +151,7 @@
forwardTimes
=
[
timeInMs
].
concat
(
forwardTimes
).
slice
(
0
,
30
)
const
avgTimeInMs
=
forwardTimes
.
reduce
((
total
,
t
)
=>
total
+
t
)
/
forwardTimes
.
length
$
(
'#time'
).
val
(
`
${
Math
.
round
(
avgTimeInMs
)}
ms`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
round
(
1000
/
avgTimeInMs
)}
`
)
$
(
'#fps'
).
val
(
`
${
faceapi
.
utils
.
round
(
1000
/
avgTimeInMs
)}
`
)
}
async
function
onPlay
()
{
...
...
examples/examples-nodejs/ageAndGenderRecognition.ts
View file @
0b4470af
...
...
@@ -19,8 +19,8 @@ async function run() {
const
{
age
,
gender
,
genderProbability
}
=
result
new
faceapi
.
draw
.
DrawTextField
(
[
`
${
faceapi
.
round
(
age
,
0
)}
years`
,
`
${
gender
}
(
${
faceapi
.
round
(
genderProbability
)}
)`
`
${
faceapi
.
utils
.
round
(
age
,
0
)}
years`
,
`
${
gender
}
(
${
faceapi
.
utils
.
round
(
genderProbability
)}
)`
],
result
.
detection
.
box
.
bottomLeft
).
draw
(
out
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment