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-06-07 17:53:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3e883c7d2e76d40f397aa7fa244c4ce313882bfd
3e883c7d
1 parent
377f31ff
Add a counting function
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
views/squatPage/squat.html
views/squatPage/squat.js
views/squatPage/squat.html
View file @
3e883c7
...
...
@@ -24,7 +24,7 @@
allow=
"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
>
</iframe>
</div>
<div
id=
"counter"
class=
"circle"
>
0
</div>
<div
id=
"counter"
class=
"circle"
></div>
</center>
</div>
<div
id=
"label-container"
class=
"label-container"
></div>
...
...
views/squatPage/squat.js
View file @
3e883c7
...
...
@@ -49,6 +49,8 @@ async function loop(timestamp) {
let
status
=
"stand"
;
// 갯수 count
let
count
=
0
;
var
counter
=
document
.
getElementById
(
"counter"
);
counter
.
textContent
=
count
;
async
function
predict
()
{
// Prediction #1: run input through posenet
...
...
@@ -62,8 +64,8 @@ async function predict() {
count
++
;
var
audio
=
new
Audio
(
'./sound/'
+
count
%
10
+
'.wav'
);
audio
.
play
();
counter
.
textContent
=
count
;
console
.
log
(
count
);
document
.
getElementById
(
"counter"
).
innerText
(
count
);
}
status
=
"stand"
}
else
if
(
prediction
[
1
].
probability
.
toFixed
(
2
)
==
1.00
)
{
// 스쿼트 자세
...
...
Please
register
or
login
to post a comment