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-08 00:32:08 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7561630b9f7783e974d89aaf5f8ec70903efb7e2
7561630b
1 parent
86bbad46
Update API for css file
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
10 deletions
server.js
views/mainPage/main.js
views/squartPage/squart.js
views/squatPage/squat.js
server.js
View file @
7561630
...
...
@@ -35,8 +35,8 @@ app.get('/', (req,res) => {
console
.
log
(
req
.
session
)
if
(
req
.
session
.
user
)
{
app
.
set
(
'views'
,
__dirname
+
'/views/squa
r
tPage'
)
res
.
render
(
'squa
r
t.html'
)
app
.
set
(
'views'
,
__dirname
+
'/views/squatPage'
)
res
.
render
(
'squat.html'
)
}
else
{
...
...
@@ -46,21 +46,34 @@ app.get('/', (req,res) => {
})
// 음성 소리 파일 전송
//
// js 파일 전송.
app
.
get
(
'/main.js'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/views/mainPage/main.js'
)
})
// css 파일 전송
app
.
get
(
'/main.css'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/views/mainPage/main.css'
)
})
// js 파일 전송.
app
.
get
(
'/squart.js'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/views/squartPage/squart.js'
)
app
.
get
(
'/squat.js'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/views/squatPage/squat.js'
)
})
// css 파일 전송
app
.
get
(
'/squat.css'
,
(
req
,
res
)
=>
{
res
.
sendFile
(
__dirname
+
'/views/squatPage/squat.css'
)
})
app
.
get
(
'/squa
r
t'
,
(
req
,
res
)
=>
{
app
.
get
(
'/squat'
,
(
req
,
res
)
=>
{
if
(
req
.
session
.
user
)
{
app
.
set
(
'views'
,
__dirname
+
'/views/squa
r
tPage'
)
res
.
render
(
'squa
r
t.html'
)
app
.
set
(
'views'
,
__dirname
+
'/views/squatPage'
)
res
.
render
(
'squat.html'
)
}
else
{
// 로그인 안되어 있으면, 스쿼트 페이지 진입 불가.
...
...
views/mainPage/main.js
View file @
7561630
...
...
@@ -23,7 +23,7 @@ $(document).ready(function(){
success
:
function
(
datas
)
{
if
(
datas
.
loginSuccess
)
{
moveSqua
r
tPage
()
moveSquatPage
()
}
else
{
...
...
@@ -54,7 +54,7 @@ $(document).ready(function(){
success
:
function
(
datas
)
{
if
(
datas
.
success
)
{
moveSqua
r
tPage
()
moveSquatPage
()
}
else
{
...
...
views/squartPage/squart.js
deleted
100644 → 0
View file @
86bbad4
File mode changed
views/squatPage/squat.js
View file @
7561630
...
...
@@ -59,7 +59,7 @@ async function predict() {
const
{
pose
,
posenetOutput
}
=
await
model
.
estimatePose
(
webcam
.
canvas
);
// Prediction 2: run input through teachable machine classification model
const
prediction
=
await
model
.
predict
(
posenetOutput
);
let
status
=
"stand"
if
(
prediction
[
0
].
probability
.
toFixed
(
2
)
>
0.9
)
{
// 서있는 상태
if
(
status
==
"squat"
){
// 전에 스쿼트 상태였다면, 일어날 때 카운트를 하나 올려줘야 함.
count
++
;
...
...
Please
register
or
login
to post a comment