Toggle navigation
Toggle navigation
This project
Loading...
Sign in
공태현
/
healthcare-with-webcam
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
공태현
2022-05-27 22:02:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
99ae40b4b8cbf9c7c8954876b4c13583c300acc7
99ae40b4
1 parent
0ba1300b
Count sqaurt good case and wrong case
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
views/squartPage/squart.html
views/squartPage/squart.html
View file @
99ae40b
...
...
@@ -54,6 +54,10 @@
await
predict
();
window
.
requestAnimationFrame
(
loop
);
}
// 상태
let
status
=
"stand"
;
// 갯수 count
let
count
=
0
;
async
function
predict
()
{
// Prediction #1: run input through posenet
...
...
@@ -62,6 +66,27 @@
// Prediction 2: run input through teachable machine classification model
const
prediction
=
await
model
.
predict
(
posenetOutput
);
if
(
prediction
[
0
].
probability
.
toFixed
(
2
)
>
0.9
)
// 서있는 상태
{
if
(
status
==
"squart"
)
{
count
++
;
}
status
=
"stand"
;
}
else
if
(
prediction
[
1
].
probability
.
toFixed
(
2
)
==
1.00
)
// 스쿼트 자세
{
status
=
"squart"
;
}
else
if
(
prediction
[
2
].
probability
.
toFixed
(
2
)
==
1.00
)
// 굽은 자세(잘못된 케이스)
{
if
(
status
==
"squart"
||
status
==
"stand"
)
// 굽은 자세로 잘못 수행하면,
{
console
.
log
(
"잘못된 경우 입니다."
)
}
status
=
"bent"
;
}
for
(
let
i
=
0
;
i
<
maxPredictions
;
i
++
)
{
const
classPrediction
=
prediction
[
i
].
className
+
": "
+
prediction
[
i
].
probability
.
toFixed
(
2
);
...
...
Please
register
or
login
to post a comment