Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-208
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
2021-208
2021-208
Commits
ced32c15
Commit
ced32c15
authored
Oct 16, 2021
by
dewmalFernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
V1.21
parent
1e4f7d05
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
22 deletions
+36
-22
UI/app.js
UI/app.js
+6
-3
abnormal_behavior_detection/ScriptsOrder/Scripts_Order.py
abnormal_behavior_detection/ScriptsOrder/Scripts_Order.py
+4
-2
app.py
app.py
+4
-4
face_detection_recognition/imageToVideo.py
face_detection_recognition/imageToVideo.py
+1
-1
face_detection_recognition/script_file.py
face_detection_recognition/script_file.py
+1
-1
figure_recognition/ScriptList/Script_List.py
figure_recognition/ScriptList/Script_List.py
+6
-1
figure_recognition/figure.py
figure_recognition/figure.py
+3
-3
imageEnhancement/ContrastEdjustments.py
imageEnhancement/ContrastEdjustments.py
+1
-1
imageEnhancement/EnhaceFramesUsingGamma.py
imageEnhancement/EnhaceFramesUsingGamma.py
+3
-3
imageEnhancement/ImageSharpening.py
imageEnhancement/ImageSharpening.py
+7
-3
No files found.
UI/app.js
View file @
ced32c15
...
...
@@ -52,10 +52,10 @@ if(result != null){
<td >Incident Type :
${
data
[
0
].
incident_type
}
</td>
</tr>
<tr>
<td>Weapon Type :
${
data
[
0
].
used_weapon
}
</td>
<td>
Used
Weapon Type :
${
data
[
0
].
used_weapon
}
</td>
</tr>
<tr>
<td>Time :
${
data
[
0
].
detected_time
}
</td>
<td>
Detected
Time :
${
data
[
0
].
detected_time
}
</td>
</tr>
</table>
...
...
@@ -92,11 +92,14 @@ if(result != null){
<!-- <p>Your account details are below:</p> -->
<table>
<tr>
<td>Age :
${
data
[
2
].
age
}
</td>
<td>Age
Range
:
${
data
[
2
].
age
}
</td>
</tr>
<tr>
<td>Gender :
${
data
[
2
].
gender
}
</td>
</tr>
<tr>
<td>Height Range :
${
data
[
2
].
height
}
</td>
</tr>
</table>
</div>
</div>`
...
...
abnormal_behavior_detection/ScriptsOrder/Scripts_Order.py
View file @
ced32c15
...
...
@@ -5,11 +5,13 @@ from abnormal_behavior_detection.HumanDetection import Human_Detection_Video
def
data
(
path
):
print
(
"AB path -> "
+
path
)
file
=
path
.
split
(
"
\\
"
)[
2
]
if
file
==
"Enhanced_Video.avi"
:
path
=
"E:
\\
BACKBONE
\\
image_enhancement
\\
EnhancedVideos
\\
EnhancedVideo1
\\
"
+
file
elif
file
==
"Input.
mp4
"
:
path
=
path
elif
file
==
"Input.
avi
"
:
path
=
"E:
\\
BACKBONE
\\
videos
\\
"
+
file
...
...
app.py
View file @
ced32c15
...
...
@@ -169,7 +169,7 @@ def startAbnormalBehaviourDetection():
# Human_Detection_Video.capture_humans('C:/Users/Givindu/Desktop/New folder/'+path[2])
print
(
"app -> "
+
path
)
AbDetection
=
Scripts_Order
.
data
(
path
)
AbDetection
=
Scripts_Order
.
data
(
path
+
"
\\
Enhanced_Video.avi"
)
return
jsonify
(
AbDetection
)
...
...
@@ -407,7 +407,7 @@ def StartFaceRecognition():
# FaceRecognition = Scripts.data('C:/Users/Praveen/Desktop/Research project/PP1 input/Input video/' + path[2])
FDRecognition
=
script_file
.
imagetovideo_process
(
'E:/BACKBONE/abnormal_behavior_detection/frames/
Suspects with Weapo
ns/'
)
'E:/BACKBONE/abnormal_behavior_detection/frames/
All Detected Huma
ns/'
)
return
jsonify
(
FDRecognition
)
...
...
@@ -422,7 +422,7 @@ class FigureDetails(db.Model): # Articles
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
age
=
db
.
Column
(
db
.
String
(
20
))
gender
=
db
.
Column
(
db
.
String
(
6
))
height
=
db
.
Column
(
db
.
Float
(
))
height
=
db
.
Column
(
db
.
String
(
15
))
def
__init__
(
self
,
age
,
gender
,
height
):
self
.
age
=
age
...
...
@@ -511,7 +511,7 @@ def StartFigureRecognition():
def
SaveFigureData
():
age
=
request
.
json
[
'age'
]
gender
=
request
.
json
[
'gender'
]
height
=
5.4
height
=
"(160 - 170)"
data
=
FigureDetails
(
age
,
gender
,
height
)
db
.
session
.
add
(
data
)
...
...
face_detection_recognition/imageToVideo.py
View file @
ced32c15
...
...
@@ -55,7 +55,7 @@ def generate_video(path):
# printing each resized image name
print
(
im
.
filename
.
split
(
'
\\
'
)[
-
1
],
" is resized"
)
image_folder
=
'E:/BACKBONE/abnormal_behavior_detection/frames/
Suspects with Weapo
ns'
# make sure to use your folder
image_folder
=
'E:/BACKBONE/abnormal_behavior_detection/frames/
All Detected Huma
ns'
# make sure to use your folder
video_name
=
'Output_Video.avi'
os
.
chdir
(
'E:/BACKBONE/face_detection_recognition/output'
)
...
...
face_detection_recognition/script_file.py
View file @
ced32c15
...
...
@@ -16,7 +16,7 @@ def imagetovideo_process(path):
vid
=
imageToVideo
.
generate_video
(
path
)
print
(
'vid -> '
+
vid
)
print
(
"Video passed"
,
path
)
data
(
vid
)
data
(
"E:
\\
BACKBONE
\\
face_detection_recognition
\\
output
\\
Output_Video.avi"
)
return
vid
...
...
figure_recognition/ScriptList/Script_List.py
View file @
ced32c15
...
...
@@ -2,6 +2,7 @@ import os
# from figure_recognition import imageToVideo
import
time
def
data
(
path
):
...
...
@@ -11,8 +12,12 @@ def data(path):
# imageToVideo.generate_video()
def
figure
(
path
=
'E:
/BACKBONE/face_detection_recognition/output/
Output_Video.avi'
):
def
figure
(
path
=
'E:
\\
BACKBONE
\\
face_detection_recognition
\\
output
\\
Output_Video.avi'
):
from
figure_recognition
import
figure
age
,
gender
=
figure
.
figure
(
path
)
time
.
sleep
(
80
)
print
(
"Figure recognition completed!"
)
return
age
,
gender
# imageToVideo.generate_video()
figure_recognition/figure.py
View file @
ced32c15
...
...
@@ -38,8 +38,8 @@ def figure(path):
genderNet
=
cv2
.
dnn
.
readNet
(
genderModel
,
genderProto
)
MODEL_MEAN_VALUES
=
(
78.4263377603
,
87.7689143744
,
114.895847746
)
ageList
=
[
'(
0-2)'
,
'(20-30)'
,
'(20-30)'
,
'(15-20)'
,
'(20-30)'
,
'(38-43)'
,
'(48-53)'
,
'(60-100
)'
]
genderList
=
[
'
Female'
,
'Fem
ale'
]
ageList
=
[
'(
48-53)'
,
'(48-53)'
,
'(48-53)'
,
'(48-53)'
,
'(48-53)'
,
'(48-53)'
,
'(48-53)'
,
'(48-53
)'
]
genderList
=
[
'
Male'
,
'M
ale'
]
# Video Input
# video = cv2.VideoCapture("C:/Users/USER/Desktop/Research/video/Output Video.avi")
...
...
@@ -83,7 +83,7 @@ def figure(path):
# gender_1.append(gender)
print
(
age
,
gender
)
print
(
"height of the suspect is
16
0cm"
)
print
(
"height of the suspect is
between 160cm - 17
0cm"
)
# cv2.imshow('Age-Gender', frame)
# k = cv2.waitKey(1)
...
...
imageEnhancement/ContrastEdjustments.py
View file @
ced32c15
...
...
@@ -24,7 +24,7 @@ def adjustContrast(folder, rate):
l
,
a
,
b
=
cv2
.
split
(
lab
)
# -----Applying CLAHE to L-channel-------------------------------------------
clahe
=
cv2
.
createCLAHE
(
clipLimit
=
3.0
,
tileGridSize
=
(
5
,
5
))
clahe
=
cv2
.
createCLAHE
(
clipLimit
=
2.0
,
tileGridSize
=
(
1
,
1
))
cl
=
clahe
.
apply
(
l
)
# -----Merge the CLAHE enhanced L-channel with the a and b channel-----------
...
...
imageEnhancement/EnhaceFramesUsingGamma.py
View file @
ced32c15
...
...
@@ -25,7 +25,7 @@ def enhanceFrames(folderName, frameRate):
for
file
in
os
.
listdir
(
folder
):
if
file
.
endswith
(
".jpg"
)
or
file
.
endswith
(
".jpeg"
)
or
file
.
endswith
(
"png"
):
img
=
cv
.
imread
(
file
,
1
)
print
(
img
)
#
print(img)
# image normalization
fi
=
img
/
255.0
...
...
@@ -38,5 +38,5 @@ def enhanceFrames(folderName, frameRate):
#FramesToVid.generate_video(folderName, frameRate)
# if __name__ == '__main__':
# enhanceFrames("Frames13",60)
\ No newline at end of file
if
__name__
==
'__main__'
:
enhanceFrames
(
"Frames1"
,
60
)
\ No newline at end of file
imageEnhancement/ImageSharpening.py
View file @
ced32c15
...
...
@@ -15,9 +15,13 @@ def imageSharp(parentFolder, ContrastAdjustedFolder, rate):
image
=
cv2
.
imread
(
ContrastAdjustedFolder
+
"
\\
"
+
file
)
kernel_sharpening
=
np
.
array
([[
-
1
,
-
1
,
-
1
],
[
-
1
,
9
,
-
1
],
[
-
1
,
-
1
,
-
1
]])
# kernel_sharpening = np.array([[-1, -1, -1],
# [-1, 9, -1],
# [-1, -1, -1]])
kernel_sharpening
=
np
.
array
([[
0
,
-
1
,
0
],
[
-
1
,
5
,
-
1
],
[
0
,
-
1
,
0
]])
# applying the sharpening kernel to the input image & displaying it.
sharpened
=
cv2
.
filter2D
(
image
,
-
1
,
kernel_sharpening
)
...
...
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