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:43:00 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
377f31ff0e714c630032fd44398feb1849edb300
377f31ff
1 parent
12e6311b
Design squat page
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
views/squatPage/squat.css
views/squatPage/squat.html
views/squatPage/squat.js
views/squatPage/squat.css
View file @
377f31f
...
...
@@ -2,7 +2,7 @@
button
{
margin
:
10px
;
margin-bottom
:
4
0px
;
margin-bottom
:
2
0px
;
}
.w-btn
{
...
...
@@ -45,12 +45,21 @@ button {
}
.Title
{
font-size
:
60px
;
font-size
:
100px
;
font-family
:
fantasy
;
color
:
aliceblue
;
margin-top
:
15%
;
text-align
:
center
;
}
.click_title
{
font-size
:
40px
;
font-family
:
fantasy
;
color
:
aliceblue
;
margin-top
:
6
0px
;
margin-top
:
4
0px
;
margin-bottom
:
20px
;
text-align
:
center
;
transition
:
500ms
;
}
.label-container
{
...
...
@@ -64,3 +73,14 @@ button {
.visible
{
visibility
:
visible
;
}
.circle
{
margin
:
20px
;
width
:
100px
;
height
:
100px
;
background-color
:
aliceblue
;
color
:
#2e2f30
;
text-align
:
center
;
border-radius
:
50%
;
line-height
:
100px
;
}
\ No newline at end of file
...
...
views/squatPage/squat.html
View file @
377f31f
...
...
@@ -8,7 +8,8 @@
<title>
Squat Page
</title>
</head>
<body
bgcolor=
"#353535"
>
<div
class=
"Title"
>
Squat Page
</div>
<div
id=
"title"
class=
"Title"
>
Squat Page
<center>
<button
class=
"w-btn w-btn-indigo"
type=
"button"
onclick=
"init()"
>
WEBCAM START
</button>
<div>
...
...
@@ -16,14 +17,16 @@
<iframe
id=
"youtube"
class=
"hidden"
width=
"560"
height=
"315
"
width=
"560"
height=
"400
"
src=
"https://www.youtube.com/embed/9WhpAVOSyl8?start=22"
title=
"YouTube video player"
frameborder=
"0"
allow=
"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
>
</iframe>
</div>
<div
id=
"counter"
class=
"circle"
>
0
</div>
</center>
</div>
<div
id=
"label-container"
class=
"label-container"
></div>
<script
src=
"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/@teachablemachine/pose@0.8/dist/teachablemachine-pose.min.js"
></script>
...
...
views/squatPage/squat.js
View file @
377f31f
...
...
@@ -13,13 +13,16 @@ async function init() {
var
target
=
document
.
getElementById
(
"youtube"
);
target
.
className
=
"visible"
;
var
target2
=
document
.
getElementById
(
"title"
);
target2
.
className
=
"click_title"
;
// load the model and metadata
// Refer to tmImage.loadFromFiles() in the API to support files from a file picker
// Note: the pose library adds a tmPose object to your window (window.tmPose)
model
=
await
tmPose
.
load
(
modelURL
,
metadataURL
);
maxPredictions
=
model
.
getTotalClasses
();
// Convenience function to setup a webcam
const
size
=
3
00
;
const
size
=
4
00
;
const
flip
=
true
;
// whether to flip the webcam
webcam
=
new
tmPose
.
Webcam
(
size
,
size
,
flip
);
// width, height, flip
await
webcam
.
setup
();
// request access to the webcam
...
...
@@ -60,6 +63,7 @@ async function predict() {
var
audio
=
new
Audio
(
'./sound/'
+
count
%
10
+
'.wav'
);
audio
.
play
();
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