Hong

addKibana

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