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-01 05:17:04 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
12257454eb784ae5a823b686387b741640374cce
12257454
1 parent
99ae40b4
showing squat videos
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
README.md
views/squartPage/squart.html
README.md
View file @
1225745
# Webcam
...
...
views/squartPage/squart.html
View file @
1225745
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Squart Page
</title>
</head>
<body>
</head>
<body>
<div>
Teachable Machine Pose Model - Squart
</div>
<button
type=
"button"
onclick=
"init()"
>
Start
</button>
<div><canvas
id=
"canvas"
></canvas></div>
<div
id=
"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>
<script
type=
"text/javascript"
>
<button
type=
"button"
onclick=
"init()"
>
Start
</button>
<div><canvas
id=
"canvas"
></canvas></div>
<div
id=
"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>
<script
type=
"text/javascript"
>
// More API functions here:
// https://github.com/googlecreativelab/teachablemachine-community/tree/master/libraries/pose
// the link to your model provided by Teachable Machine export panel
const
URL
=
"https://teachablemachine.withgoogle.com/models/xymjZj4q-/"
;
// 임시 URI - stand , squart, bent(허리 굽은 자세) 학습.
let
model
,
webcam
,
ctx
,
labelContainer
,
maxPredictions
;
...
...
@@ -30,15 +29,13 @@
// 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
=
2
00
;
const
size
=
6
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
await
webcam
.
play
();
window
.
requestAnimationFrame
(
loop
);
// append/get elements to the DOM
const
canvas
=
document
.
getElementById
(
"canvas"
);
canvas
.
width
=
size
;
canvas
.
height
=
size
;
...
...
@@ -108,7 +105,8 @@
}
}
}
</script>
</body>
</script>
<!-- 유튜브 영상 띄우기 -->
<iframe
width=
"560"
height=
"315"
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>
</body>
</html>
...
...
Please
register
or
login
to post a comment