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
d114007d
Commit
d114007d
authored
Nov 18, 2018
by
vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testcases for detectSingleFace
parent
0c493fc2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
1 deletion
+133
-1
mtcnn.test.ts
test/tests/mtcnn/mtcnn.test.ts
+26
-0
ssdMobilenetv1.node.test.ts
test/tests/ssdMobilenetv1/ssdMobilenetv1.node.test.ts
+27
-0
ssdMobilenetv1.test.ts
test/tests/ssdMobilenetv1/ssdMobilenetv1.test.ts
+27
-0
tinyFaceDetector.node.test.ts
test/tests/tinyFaceDetector/tinyFaceDetector.node.test.ts
+26
-0
tinyFaceDetector.test.ts
test/tests/tinyFaceDetector/tinyFaceDetector.test.ts
+27
-1
No files found.
test/tests/mtcnn/mtcnn.test.ts
View file @
d114007d
import
*
as
faceapi
from
'../../../src'
;
import
*
as
faceapi
from
'../../../src'
;
import
{
FullFaceDescription
}
from
'../../../src/classes/FullFaceDescription'
;
import
{
MtcnnOptions
}
from
'../../../src/mtcnn/MtcnnOptions'
;
import
{
MtcnnOptions
}
from
'../../../src/mtcnn/MtcnnOptions'
;
import
{
loadImage
}
from
'../../env'
;
import
{
loadImage
}
from
'../../env'
;
import
{
expectFaceDetections
}
from
'../../expectFaceDetections'
;
import
{
expectFaceDetections
}
from
'../../expectFaceDetections'
;
...
@@ -75,6 +76,31 @@ describe('mtcnn', () => {
...
@@ -75,6 +76,31 @@ describe('mtcnn', () => {
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
})
})
it
(
'detectSingleFace.withFaceLandmarks().withFaceDescriptor()'
,
async
()
=>
{
const
options
=
new
MtcnnOptions
({
minFaceSize
:
20
})
const
result
=
await
faceapi
.
detectSingleFace
(
imgEl
,
options
)
.
withFaceLandmarks
()
.
withFaceDescriptor
()
const
deltas
=
{
maxScoreDelta
:
0.01
,
maxBoxDelta
:
10
,
maxLandmarksDelta
:
6
,
maxDescriptorDelta
:
0.2
}
expect
(
result
instanceof
FullFaceDescription
).
toBe
(
true
)
expectFullFaceDescriptions
(
[
result
as
FullFaceDescription
],
[
expectedFullFaceDescriptions
[
0
]],
[
expectedScores
[
0
]],
deltas
)
})
it
(
'no memory leaks'
,
async
()
=>
{
it
(
'no memory leaks'
,
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
faceapi
await
faceapi
...
...
test/tests/ssdMobilenetv1/ssdMobilenetv1.node.test.ts
View file @
d114007d
...
@@ -7,6 +7,7 @@ import { expectFaceDetectionsWithLandmarks } from '../../expectFaceDetectionsWit
...
@@ -7,6 +7,7 @@ import { expectFaceDetectionsWithLandmarks } from '../../expectFaceDetectionsWit
import
{
expectedSsdBoxes
}
from
'./expectedBoxes'
;
import
{
expectedSsdBoxes
}
from
'./expectedBoxes'
;
import
{
loadImage
}
from
'../../env'
;
import
{
loadImage
}
from
'../../env'
;
import
*
as
tf
from
'@tensorflow/tfjs-core'
;
import
*
as
tf
from
'@tensorflow/tfjs-core'
;
import
{
FullFaceDescription
}
from
'../../../src/classes/FullFaceDescription'
;
describe
(
'ssdMobilenetv1 - node'
,
()
=>
{
describe
(
'ssdMobilenetv1 - node'
,
()
=>
{
...
@@ -72,6 +73,32 @@ describe('ssdMobilenetv1 - node', () => {
...
@@ -72,6 +73,32 @@ describe('ssdMobilenetv1 - node', () => {
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
})
})
it
(
'detectSingleFace.withFaceLandmarks().withFaceDescriptor()'
,
async
()
=>
{
const
options
=
new
SsdMobilenetv1Options
({
minConfidence
:
0.5
})
const
result
=
await
faceapi
.
detectSingleFace
(
imgTensor
,
options
)
.
withFaceLandmarks
()
.
withFaceDescriptor
()
const
deltas
=
{
maxScoreDelta
:
0.05
,
maxBoxDelta
:
5
,
maxLandmarksDelta
:
4
,
maxDescriptorDelta
:
0.2
}
expect
(
result
instanceof
FullFaceDescription
).
toBe
(
true
)
expectFullFaceDescriptions
(
[
result
as
FullFaceDescription
],
[
expectedFullFaceDescriptions
[
2
]],
[
expectedScores
[
2
]],
deltas
)
})
it
(
'no memory leaks'
,
async
()
=>
{
it
(
'no memory leaks'
,
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
faceapi
await
faceapi
...
...
test/tests/ssdMobilenetv1/ssdMobilenetv1.test.ts
View file @
d114007d
...
@@ -6,6 +6,7 @@ import { expectFullFaceDescriptions } from '../../expectFullFaceDescriptions';
...
@@ -6,6 +6,7 @@ import { expectFullFaceDescriptions } from '../../expectFullFaceDescriptions';
import
{
expectFaceDetectionsWithLandmarks
}
from
'../../expectFaceDetectionsWithLandmarks'
;
import
{
expectFaceDetectionsWithLandmarks
}
from
'../../expectFaceDetectionsWithLandmarks'
;
import
{
expectedSsdBoxes
}
from
'./expectedBoxes'
;
import
{
expectedSsdBoxes
}
from
'./expectedBoxes'
;
import
{
loadImage
}
from
'../../env'
;
import
{
loadImage
}
from
'../../env'
;
import
{
FullFaceDescription
}
from
'../../../src/classes/FullFaceDescription'
;
describe
(
'ssdMobilenetv1'
,
()
=>
{
describe
(
'ssdMobilenetv1'
,
()
=>
{
...
@@ -71,6 +72,32 @@ describe('ssdMobilenetv1', () => {
...
@@ -71,6 +72,32 @@ describe('ssdMobilenetv1', () => {
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
})
})
it
(
'detectSingleFace.withFaceLandmarks().withFaceDescriptor()'
,
async
()
=>
{
const
options
=
new
SsdMobilenetv1Options
({
minConfidence
:
0.5
})
const
result
=
await
faceapi
.
detectSingleFace
(
imgEl
,
options
)
.
withFaceLandmarks
()
.
withFaceDescriptor
()
const
deltas
=
{
maxScoreDelta
:
0.05
,
maxBoxDelta
:
5
,
maxLandmarksDelta
:
2
,
maxDescriptorDelta
:
0.2
}
expect
(
result
instanceof
FullFaceDescription
).
toBe
(
true
)
expectFullFaceDescriptions
(
[
result
as
FullFaceDescription
],
[
expectedFullFaceDescriptions
[
2
]],
[
expectedScores
[
2
]],
deltas
)
})
it
(
'no memory leaks'
,
async
()
=>
{
it
(
'no memory leaks'
,
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
faceapi
await
faceapi
...
...
test/tests/tinyFaceDetector/tinyFaceDetector.node.test.ts
View file @
d114007d
...
@@ -7,6 +7,7 @@ import { expectFaceDetectionsWithLandmarks } from '../../expectFaceDetectionsWit
...
@@ -7,6 +7,7 @@ import { expectFaceDetectionsWithLandmarks } from '../../expectFaceDetectionsWit
import
{
expectedTinyFaceDetectorBoxes
}
from
'./expectedBoxes'
;
import
{
expectedTinyFaceDetectorBoxes
}
from
'./expectedBoxes'
;
import
{
loadImage
}
from
'../../env'
;
import
{
loadImage
}
from
'../../env'
;
import
*
as
tf
from
'@tensorflow/tfjs-core'
;
import
*
as
tf
from
'@tensorflow/tfjs-core'
;
import
{
FullFaceDescription
}
from
'../../../src/classes/FullFaceDescription'
;
describe
(
'tinyFaceDetector - node'
,
()
=>
{
describe
(
'tinyFaceDetector - node'
,
()
=>
{
...
@@ -72,6 +73,31 @@ describe('tinyFaceDetector - node', () => {
...
@@ -72,6 +73,31 @@ describe('tinyFaceDetector - node', () => {
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
})
})
it
(
'detectSingleFace.withFaceLandmarks().withFaceDescriptor()'
,
async
()
=>
{
const
options
=
new
TinyFaceDetectorOptions
({
inputSize
:
416
})
const
result
=
await
faceapi
.
detectSingleFace
(
imgTensor
,
options
)
.
withFaceLandmarks
()
.
withFaceDescriptor
()
const
deltas
=
{
maxScoreDelta
:
0.05
,
maxBoxDelta
:
5
,
maxLandmarksDelta
:
10
,
maxDescriptorDelta
:
0.2
}
expect
(
result
instanceof
FullFaceDescription
).
toBe
(
true
)
expectFullFaceDescriptions
(
[
result
as
FullFaceDescription
],
[
expectedFullFaceDescriptions
[
2
]],
[
expectedScores
[
2
]],
deltas
)
})
it
(
'no memory leaks'
,
async
()
=>
{
it
(
'no memory leaks'
,
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
faceapi
await
faceapi
...
...
test/tests/tinyFaceDetector/tinyFaceDetector.test.ts
View file @
d114007d
import
*
as
faceapi
from
'../../../src'
;
import
*
as
faceapi
from
'../../../src'
;
import
{
describeWithNets
,
expectAllTensorsReleased
,
assembleExpectedFullFaceDescriptions
,
ExpectedFullFaceDescription
}
from
'../../utils'
;
import
{
describeWithNets
,
expectAllTensorsReleased
,
assembleExpectedFullFaceDescriptions
,
ExpectedFullFaceDescription
}
from
'../../utils'
;
import
{
fetchImage
,
TinyFaceDetectorOptions
}
from
'../../../src'
;
import
{
TinyFaceDetectorOptions
}
from
'../../../src'
;
import
{
expectFaceDetections
}
from
'../../expectFaceDetections'
;
import
{
expectFaceDetections
}
from
'../../expectFaceDetections'
;
import
{
expectFullFaceDescriptions
}
from
'../../expectFullFaceDescriptions'
;
import
{
expectFullFaceDescriptions
}
from
'../../expectFullFaceDescriptions'
;
import
{
expectFaceDetectionsWithLandmarks
}
from
'../../expectFaceDetectionsWithLandmarks'
;
import
{
expectFaceDetectionsWithLandmarks
}
from
'../../expectFaceDetectionsWithLandmarks'
;
import
{
expectedTinyFaceDetectorBoxes
}
from
'./expectedBoxes'
;
import
{
expectedTinyFaceDetectorBoxes
}
from
'./expectedBoxes'
;
import
{
loadImage
}
from
'../../env'
;
import
{
loadImage
}
from
'../../env'
;
import
{
FullFaceDescription
}
from
'../../../src/classes/FullFaceDescription'
;
describe
(
'tinyFaceDetector'
,
()
=>
{
describe
(
'tinyFaceDetector'
,
()
=>
{
...
@@ -71,6 +72,31 @@ describe('tinyFaceDetector', () => {
...
@@ -71,6 +72,31 @@ describe('tinyFaceDetector', () => {
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
expectFullFaceDescriptions
(
results
,
expectedFullFaceDescriptions
,
expectedScores
,
deltas
)
})
})
it
(
'detectSingleFace.withFaceLandmarks().withFaceDescriptor()'
,
async
()
=>
{
const
options
=
new
TinyFaceDetectorOptions
({
inputSize
:
416
})
const
result
=
await
faceapi
.
detectSingleFace
(
imgEl
,
options
)
.
withFaceLandmarks
()
.
withFaceDescriptor
()
const
deltas
=
{
maxScoreDelta
:
0.05
,
maxBoxDelta
:
5
,
maxLandmarksDelta
:
10
,
maxDescriptorDelta
:
0.2
}
expect
(
result
instanceof
FullFaceDescription
).
toBe
(
true
)
expectFullFaceDescriptions
(
[
result
as
FullFaceDescription
],
[
expectedFullFaceDescriptions
[
2
]],
[
expectedScores
[
2
]],
deltas
)
})
it
(
'no memory leaks'
,
async
()
=>
{
it
(
'no memory leaks'
,
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
expectAllTensorsReleased
(
async
()
=>
{
await
faceapi
await
faceapi
...
...
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