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
4c7fb27f
Commit
4c7fb27f
authored
Mar 18, 2019
by
Javier Ledo Vázquez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change arrayAsync
parent
fe895c12
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
37 deletions
+30
-37
package-lock.json
package-lock.json
+8
-21
stage2.ts
src/mtcnn/stage2.ts
+8
-6
stage3.ts
src/mtcnn/stage3.ts
+14
-10
No files found.
package-lock.json
View file @
4c7fb27f
...
@@ -123,17 +123,17 @@
...
@@ -123,17 +123,17 @@
},
},
"@types/seedrandom"
:
{
"@types/seedrandom"
:
{
"version"
:
"2.4.27"
,
"version"
:
"2.4.27"
,
"resolved"
:
"http
s://tclar30.es.telefonica/artifacts/repo/npm
/@types/seedrandom/-/seedrandom-2.4.27.tgz"
,
"resolved"
:
"http
://registry.npmjs.org
/@types/seedrandom/-/seedrandom-2.4.27.tgz"
,
"integrity"
:
"sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE="
"integrity"
:
"sha1-nbVjk33YaRX2kJK8QyWdL0hXjkE="
},
},
"@types/webgl-ext"
:
{
"@types/webgl-ext"
:
{
"version"
:
"0.0.30"
,
"version"
:
"0.0.30"
,
"resolved"
:
"https://
tclar30.es.telefonica/artifacts/repo/npm
/@types/webgl-ext/-/webgl-ext-0.0.30.tgz"
,
"resolved"
:
"https://
registry.npmjs.org
/@types/webgl-ext/-/webgl-ext-0.0.30.tgz"
,
"integrity"
:
"sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg=="
"integrity"
:
"sha512-LKVgNmBxN0BbljJrVUwkxwRYqzsAEPcZOe6S2T6ZaBDIrFp0qu4FNlpc5sM1tGbXUYFgdVQIoeLk1Y1UoblyEg=="
},
},
"@types/webgl2"
:
{
"@types/webgl2"
:
{
"version"
:
"0.0.4"
,
"version"
:
"0.0.4"
,
"resolved"
:
"https://
tclar30.es.telefonica/artifacts/repo/npm
/@types/webgl2/-/webgl2-0.0.4.tgz"
,
"resolved"
:
"https://
registry.npmjs.org
/@types/webgl2/-/webgl2-0.0.4.tgz"
,
"integrity"
:
"sha512-PACt1xdErJbMUOUweSrbVM7gSIYm1vTncW2hF6Os/EeWi6TXYAYMPp+8v6rzHmypE5gHrxaxZNXgMkJVIdZpHw=="
"integrity"
:
"sha512-PACt1xdErJbMUOUweSrbVM7gSIYm1vTncW2hF6Os/EeWi6TXYAYMPp+8v6rzHmypE5gHrxaxZNXgMkJVIdZpHw=="
},
},
"abbrev"
:
{
"abbrev"
:
{
...
@@ -4718,7 +4718,7 @@
...
@@ -4718,7 +4718,7 @@
},
},
"seedrandom"
:
{
"seedrandom"
:
{
"version"
:
"2.4.3"
,
"version"
:
"2.4.3"
,
"resolved"
:
"https://
tclar30.es.telefonica/artifacts/repo/npm
/seedrandom/-/seedrandom-2.4.3.tgz"
,
"resolved"
:
"https://
registry.npmjs.org
/seedrandom/-/seedrandom-2.4.3.tgz"
,
"integrity"
:
"sha1-JDhQTa0zkXMUv/GKxNeU8W1qrsw="
"integrity"
:
"sha1-JDhQTa0zkXMUv/GKxNeU8W1qrsw="
},
},
"semver"
:
{
"semver"
:
{
...
@@ -5240,25 +5240,12 @@
...
@@ -5240,25 +5240,12 @@
}
}
},
},
"tfjs-image-recognition-base"
:
{
"tfjs-image-recognition-base"
:
{
"version"
:
"0.
4.1
"
,
"version"
:
"0.
5.0
"
,
"resolved"
:
"https://registry.npmjs.org/tfjs-image-recognition-base/-/tfjs-image-recognition-base-0.
4.1
.tgz"
,
"resolved"
:
"https://registry.npmjs.org/tfjs-image-recognition-base/-/tfjs-image-recognition-base-0.
5.0
.tgz"
,
"integrity"
:
"sha512-
oJOLByZa0OgPaLB17ZlL2qO8dIQwgV1ma4/iEFbzVbF8yd0qOomIuEGvyPzXDfD0dmyPwzj8Ysa3Jq+O375Fpw
=="
,
"integrity"
:
"sha512-
u/BPhsoieBm8bE3QXd5WdKmo/CKXoeab0x4x11yyg7O24esUM9RqdX9dI5Byw8jcjjrb705izSSznqXr61GTHg
=="
,
"requires"
:
{
"requires"
:
{
"@tensorflow/tfjs-core"
:
"
0.14.2
"
,
"@tensorflow/tfjs-core"
:
"
1.0.1
"
,
"tslib"
:
"^1.9.3"
"tslib"
:
"^1.9.3"
},
"dependencies"
:
{
"@tensorflow/tfjs-core"
:
{
"version"
:
"0.14.2"
,
"resolved"
:
"https://tclar30.es.telefonica/artifacts/repo/npm/@tensorflow/tfjs-core/-/tfjs-core-0.14.2.tgz"
,
"integrity"
:
"sha512-VVbcu6H3ioKCkfkep/gQASfzPnQt3C5v+4ppH9pQ6Lf0lD+l3NMuMJYxa8Wjac1TfiWhFEX58bJvhpMfTGsUlg=="
,
"requires"
:
{
"@types/seedrandom"
:
"2.4.27"
,
"@types/webgl-ext"
:
"0.0.30"
,
"@types/webgl2"
:
"0.0.4"
,
"seedrandom"
:
"2.4.3"
}
}
}
}
},
},
"through2"
:
{
"through2"
:
{
...
...
src/mtcnn/stage2.ts
View file @
4c7fb27f
...
@@ -54,13 +54,15 @@ export async function stage2(
...
@@ -54,13 +54,15 @@ export async function stage2(
)
)
stats
.
stage2_nms
=
Date
.
now
()
-
ts
stats
.
stage2_nms
=
Date
.
now
()
-
ts
const
regions
=
indicesNms
.
map
(
idx
=>
const
regions
=
indicesNms
.
map
(
idx
=>
{
new
MtcnnBox
(
const
regionsData
=
rnetOuts
[
indices
[
idx
]].
regions
.
arraySync
()
rnetOuts
[
indices
[
idx
]].
regions
.
arraySync
()[
0
][
0
],
return
new
MtcnnBox
(
rnetOuts
[
indices
[
idx
]].
regions
.
arraySync
()[
0
][
1
],
regionsData
[
0
][
0
],
rnetOuts
[
indices
[
idx
]].
regions
.
arraySync
()[
0
][
2
],
regionsData
[
0
][
1
],
rnetOuts
[
indices
[
idx
]].
regions
.
arraySync
()[
0
][
3
]
regionsData
[
0
][
2
],
regionsData
[
0
][
3
]
)
)
}
)
)
finalScores
=
indicesNms
.
map
(
idx
=>
filteredScores
[
idx
])
finalScores
=
indicesNms
.
map
(
idx
=>
filteredScores
[
idx
])
...
...
src/mtcnn/stage3.ts
View file @
4c7fb27f
...
@@ -39,12 +39,14 @@ export async function stage3(
...
@@ -39,12 +39,14 @@ export async function stage3(
.
filter
(
c
=>
c
.
score
>
scoreThreshold
)
.
filter
(
c
=>
c
.
score
>
scoreThreshold
)
.
map
(({
idx
})
=>
idx
)
.
map
(({
idx
})
=>
idx
)
const
filteredRegions
=
indices
.
map
(
idx
=>
new
MtcnnBox
(
const
filteredRegions
=
indices
.
map
(
idx
=>
{
onetOuts
[
idx
].
regions
.
arraySync
()[
0
][
0
],
const
regionsData
=
onetOuts
[
idx
].
regions
.
arraySync
();
onetOuts
[
idx
].
regions
.
arraySync
()[
0
][
1
],
return
new
MtcnnBox
(
onetOuts
[
idx
].
regions
.
arraySync
()[
0
][
2
],
regionsData
[
0
][
0
],
onetOuts
[
idx
].
regions
.
arraySync
()[
0
][
3
]
regionsData
[
0
][
1
],
))
regionsData
[
0
][
2
],
regionsData
[
0
][
3
]
)})
const
filteredBoxes
=
indices
const
filteredBoxes
=
indices
.
map
((
idx
,
i
)
=>
inputBoxes
[
idx
].
calibrate
(
filteredRegions
[
i
]))
.
map
((
idx
,
i
)
=>
inputBoxes
[
idx
].
calibrate
(
filteredRegions
[
i
]))
const
filteredScores
=
indices
.
map
(
idx
=>
scores
[
idx
])
const
filteredScores
=
indices
.
map
(
idx
=>
scores
[
idx
])
...
@@ -67,11 +69,13 @@ export async function stage3(
...
@@ -67,11 +69,13 @@ export async function stage3(
finalBoxes
=
indicesNms
.
map
(
idx
=>
filteredBoxes
[
idx
])
finalBoxes
=
indicesNms
.
map
(
idx
=>
filteredBoxes
[
idx
])
finalScores
=
indicesNms
.
map
(
idx
=>
filteredScores
[
idx
])
finalScores
=
indicesNms
.
map
(
idx
=>
filteredScores
[
idx
])
points
=
indicesNms
.
map
((
idx
,
i
)
=>
points
=
indicesNms
.
map
((
idx
,
i
)
=>
Array
(
5
).
fill
(
0
).
map
((
_
,
ptIdx
)
=>
Array
(
5
).
fill
(
0
).
map
((
_
,
ptIdx
)
=>
{
new
Point
(
const
pointsData
=
onetOuts
[
idx
].
points
.
arraySync
()
((
onetOuts
[
idx
].
points
.
arraySync
()[
0
][
ptIdx
]
*
(
finalBoxes
[
i
].
width
+
1
))
+
finalBoxes
[
i
].
left
)
,
return
new
Point
(
((
onetOuts
[
idx
].
points
.
arraySync
()[
0
][
ptIdx
+
5
]
*
(
finalBoxes
[
i
].
height
+
1
))
+
finalBoxes
[
i
].
top
)
((
pointsData
[
0
][
ptIdx
]
*
(
finalBoxes
[
i
].
width
+
1
))
+
finalBoxes
[
i
].
left
)
,
((
pointsData
[
0
][
ptIdx
+
5
]
*
(
finalBoxes
[
i
].
height
+
1
))
+
finalBoxes
[
i
].
top
)
)
)
}
)
)
)
)
}
}
...
...
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