Hong

addKibana

......@@ -121,7 +121,7 @@ def main(yolo):
w = int(video_capture.get(3))
h = int(video_capture.get(4))
total_frame = int(video_capture.get(cv2.CAP_PROP_FRAME_COUNT))
fourcc = cv2.VideoWriter_fourcc(*'MP4V')
fourcc = cv2.VideoWriter_fourcc(*'avc1')
out = cv2.VideoWriter(os.getcwd() + '/public/data/'+file_name+'.mp4', fourcc, 15, (w, h))
list_file = open(os.getcwd() + '/../deep_sort_yolov4/detection_rslt.txt', 'w')
frame_index = -1
......@@ -196,7 +196,7 @@ def main(yolo):
if len(class_names) > 0:
class_name = class_names[0]
cv2.putText(frame, str(class_names[0]),(int(((bbox[0])+(bbox[2]))/2), int(((bbox[1])+(bbox[3]))/2 + 10)),0, 5e-3 * 150, (color),2)
cv2.putText(frame, str(class_names[0]),(int(((bbox[0])+(bbox[2]))/2-30), int(((bbox[1])+(bbox[3]))/2 + 10)),0, 5e-3 * 150, (color),2)
i += 1
#bbox_center_point(x,y)
......@@ -223,10 +223,10 @@ def main(yolo):
count = len(set(counter))
if (cFrame%10==0):
df2 = df2.append({'total':count,'now':i,'time':cTime,'s': cs},ignore_index=True)
cv2.putText(frame, "Total Pedestrian Counter: "+str(count),(int(30), int(105)),0, 5e-3 * 150, (0,255,0),2)
cv2.putText(frame, "Current Pedestrian Counter: "+str(i),(int(30), int(80)),0, 5e-3 * 150, (0,255,0),2)
cv2.putText(frame, "Total Pedestrian Counter: "+str(count),(int(50), int(105)),0, 5e-3 * 150, (0,255,0),2)
cv2.putText(frame, "Current Pedestrian Counter: "+str(i),(int(50), int(80)),0, 5e-3 * 150, (0,255,0),2)
#cv2.putText(frame, "FPS: %f"%(fps),(int(20), int(40)),0, 5e-3 * 200, (0,255,0),3)
cv2.putText(frame, "Time: " + str(cTime),(int(30), int(55)),0, 5e-3 * 150, (0,255,0),3)
cv2.putText(frame, "Time: " + str(cTime),(int(50), int(55)),0, 5e-3 * 150, (0,255,0),3)
cv2.namedWindow("YOLO4_Deep_SORT", 0);
cv2.resizeWindow('YOLO4_Deep_SORT', 1024, 768);
cv2.imshow('YOLO4_Deep_SORT', frame)
......
This file is too large to display.
......@@ -2,11 +2,14 @@
$(document).on('click', '.test-btn', function(e) {
$('.container-video').empty()
let v = '<video src="data/output2.avi" width="400" controls autoplay></video>'
let v = '<video id = "myVideo" src="data/test3.mp4" type="video/mp4" width="500" height="350" controls autoplay></video><p>결과 영상</p>'
$('.container-video').append(v);
$('.container-kmeans').empty()
let i = '<img src="data/test3_kmeans.png" style="width: 100%;" alt="Kmeans Image">'
$('.container-kmeans').append(i);
$('.container-kibana').empty()
let k = '<a href="http://localhost:5601/goto/0eca14f7b381e3c38aaf650677fe771d">분석 결과</a>'
$('.container-kibana').append(k);
});
......
......@@ -45,12 +45,5 @@ router.post('/create', upload.single("File"), function(req, res) {
res.render('result', { file_name: file.originalname.split('.')[0] });
}
});
// PythonShell.PythonShell.run('main.py', options, (err, results) => {
// if (err) throw err;
// PythonShell.PythonShell.run('kmean.py', options2, (err, results) => {
// if (err) throw err;
// res.render('result', { file_name: file.originalname.split('.')[0] });
// });
// });
});
module.exports = router;
\ No newline at end of file
......
......@@ -88,8 +88,8 @@
<div class="p-5"></div>
<!-- /.container-fluid -->
<div class="container row">
<div class="container-video col-md-6"></div>
<div class="container-kmeans col-md-6"></div>
<div class="container-video col-md-6 well"></div>
<div class="container-kmeans col-md-6 well"></div>
</div>
<div class="container-kibana"></div>
......
......@@ -92,7 +92,7 @@
<img src="data/<%=file_name%>_kmeans.png" style="width: 100%;" alt="Kmeans Image">
</div>
</div>
<div class="container-kibana"></div>
<div class="container-kibana"><a href="http://localhost:5601/goto/0eca14f7b381e3c38aaf650677fe771d">분석 결과</a></div>
</div>
<!-- End of Main Content -->
......