Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sachith Fernando
2020-101
Commits
9fa0f329
Commit
9fa0f329
authored
Dec 19, 2020
by
I.K Seneviratne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Committing the modification in some files.
parent
505c9017
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
71 deletions
+129
-71
FirstApp/emotion_detector.py
FirstApp/emotion_detector.py
+7
-6
FirstApp/logic/activity_recognition.py
FirstApp/logic/activity_recognition.py
+119
-63
FirstApp/templates/FirstApp/video_results.html
FirstApp/templates/FirstApp/video_results.html
+3
-2
No files found.
FirstApp/emotion_detector.py
View file @
9fa0f329
...
@@ -216,18 +216,19 @@ def get_frame_emotion_recognition(video_name):
...
@@ -216,18 +216,19 @@ def get_frame_emotion_recognition(video_name):
surprise_count
=
0
surprise_count
=
0
# get the detections
# get the detections
detections
=
ar
.
person_detection
(
image
,
net
)
detections
,
persons
=
ar
.
person_detection
(
image
,
net
)
# to count the extracted detections for a frame
# to count the extracted detections for a frame
detection_count
=
0
detection_count
=
0
# if there are detections
# if there are detections
if
(
len
(
detections
)
>
0
):
if
(
len
(
detections
)
>
0
):
# loop through the detections
# loop through the detections
for
detection
in
detecti
ons
:
for
person
in
pers
ons
:
label
=
emotion_recognition
(
classifier
,
face_classifier
,
detecti
on
)
label
=
emotion_recognition
(
classifier
,
face_classifier
,
pers
on
)
# checking for the label
# checking for the label
if
label
==
class_labels
[
0
]:
if
label
==
class_labels
[
0
]:
...
@@ -422,17 +423,17 @@ def emotion_frame_groupings(video_name, frame_landmarks, frame_group_dict):
...
@@ -422,17 +423,17 @@ def emotion_frame_groupings(video_name, frame_landmarks, frame_group_dict):
neutral_count
=
0
neutral_count
=
0
detection_count
=
0
detection_count
=
0
detections
=
ar
.
person_detection
(
image
,
net
)
detections
,
persons
=
ar
.
person_detection
(
image
,
net
)
# if there are detections
# if there are detections
if
(
len
(
detections
)
>
0
):
if
(
len
(
detections
)
>
0
):
# looping through the detections in each frame
# looping through the detections in each frame
for
detection
in
detecti
ons
:
for
person
in
pers
ons
:
# run the model and get the emotion label
# run the model and get the emotion label
label
=
emotion_recognition
(
classifier
,
face_classifier
,
detecti
on
)
label
=
emotion_recognition
(
classifier
,
face_classifier
,
pers
on
)
# increment the count based on the label
# increment the count based on the label
if
label
==
class_labels
[
0
]:
if
label
==
class_labels
[
0
]:
...
...
FirstApp/logic/activity_recognition.py
View file @
9fa0f329
This diff is collapsed.
Click to expand it.
FirstApp/templates/FirstApp/video_results.html
View file @
9fa0f329
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
let
folder
=
''
;
let
folder
=
''
;
$
(
'
#activity_loader
'
).
attr
(
'
hidden
'
,
false
);
{
#
$
(
'
#activity_loader
'
).
attr
(
'
hidden
'
,
false
);
#
}
{
#
$
(
'
#emotion_loader
'
).
attr
(
'
hidden
'
,
false
);
#
}
{
#
$
(
'
#emotion_loader
'
).
attr
(
'
hidden
'
,
false
);
#
}
{
#
$
(
'
#gaze_loader
'
).
attr
(
'
hidden
'
,
false
);
#
}
{
#
$
(
'
#gaze_loader
'
).
attr
(
'
hidden
'
,
false
);
#
}
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
}
}
//this is a test function (delete later)
//this is a test function (delete later)
/*
let interval = setInterval(() => {
let interval = setInterval(() => {
{#let url = 'http://127.0.0.1:8000/get-random_number';#}
{#let url = 'http://127.0.0.1:8000/get-random_number';#}
...
@@ -355,6 +355,7 @@
...
@@ -355,6 +355,7 @@
}
}
*/
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment