Commit ced32c15 authored by dewmalFernando's avatar dewmalFernando

V1.21

parent 1e4f7d05
......@@ -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>`
......
......@@ -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
......
......@@ -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 Weapons/')
'E:/BACKBONE/abnormal_behavior_detection/frames/All Detected Humans/')
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)
......
......@@ -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 Weapons' # make sure to use your folder
image_folder = 'E:/BACKBONE/abnormal_behavior_detection/frames/All Detected Humans' # make sure to use your folder
video_name = 'Output_Video.avi'
os.chdir('E:/BACKBONE/face_detection_recognition/output')
......
......@@ -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
......
......@@ -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()
......@@ -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', 'Female']
ageList = ['(48-53)', '(48-53)', '(48-53)', '(48-53)', '(48-53)', '(48-53)', '(48-53)', '(48-53)']
genderList = ['Male', 'Male']
# 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 160cm")
print("height of the suspect is between 160cm - 170cm")
# cv2.imshow('Age-Gender', frame)
# k = cv2.waitKey(1)
......
......@@ -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-----------
......
......@@ -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
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment