From 3d7a847d470bf8b8fc136c85728c1ba86992f38c Mon Sep 17 00:00:00 2001 From: seungriyou Date: Fri, 10 Jun 2022 06:28:35 +0000 Subject: [PATCH 1/4] [Feat] Add parameters for demo issue #98 --- serving/backend/app/ml/face_functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/serving/backend/app/ml/face_functions.py b/serving/backend/app/ml/face_functions.py index e2b21a0..13eaf9e 100644 --- a/serving/backend/app/ml/face_functions.py +++ b/serving/backend/app/ml/face_functions.py @@ -22,7 +22,10 @@ def FaceClustering(video_path: str = "", save_dir:str = ""): extractor = FaceExtractor( video_path=video_path, data_dir=None, - result_dir=save_dir + result_dir=save_dir, + threshold=0.65, + face_cnt=280, # demo 용 + skip=60 # demo 용 ) # Extract Faces From 96f4073e4cd8437196fd3625fffcb54ce6a5018b Mon Sep 17 00:00:00 2001 From: seungriyou Date: Fri, 10 Jun 2022 06:29:14 +0000 Subject: [PATCH 2/4] [Fix] Modify height condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 실험 결과가 재현되지 않는 문제점을 해결하기 위해 height 조건을 수정하였습니다. issue #98 --- serving/backend/app/ml/face_recognizer/face_recog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serving/backend/app/ml/face_recognizer/face_recog.py b/serving/backend/app/ml/face_recognizer/face_recog.py index 76fdd50..7b639f9 100644 --- a/serving/backend/app/ml/face_recognizer/face_recog.py +++ b/serving/backend/app/ml/face_recognizer/face_recog.py @@ -127,7 +127,7 @@ def recognize_faces(self): last_original_frame = last_original_frame[:, :, ::-1] height, width = last_original_frame.shape[:2] last_original_frame = last_original_frame[int(height*0.2):, int(width*0.2):int(width*0.8)] - if height > 600: + if height > 800: last_original_frame = cv2.resize(last_original_frame, None, fx=0.6, fy=0.6) frames.append(last_original_frame) frames_real_time.append(frame_num-1) @@ -135,7 +135,7 @@ def recognize_faces(self): start_original_frame = start_original_frame[:, :, ::-1] height, width = start_original_frame.shape[:2] start_original_frame = start_original_frame[int(height*0.2):, int(width*0.2):int(width*0.8)] - if height > 600: + if height > 800: start_original_frame = cv2.resize(start_original_frame, None, fx=0.6, fy=0.6) frames.append(start_original_frame) frames_real_time.append(frame_num) From 02d7cb1e14dafd4951da675ada0c7d5f370b2f16 Mon Sep 17 00:00:00 2001 From: seungriyou Date: Fri, 10 Jun 2022 06:30:46 +0000 Subject: [PATCH 3/4] [Fix] Modify duration calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 영상의 duration을 계산하는 코드를 수정하였습니다. (+5초) issue #98 --- serving/backend/app/ml/final_shorts/final_timeline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serving/backend/app/ml/final_shorts/final_timeline.py b/serving/backend/app/ml/final_shorts/final_timeline.py index 191c38c..0e274f1 100644 --- a/serving/backend/app/ml/final_shorts/final_timeline.py +++ b/serving/backend/app/ml/final_shorts/final_timeline.py @@ -19,13 +19,13 @@ def make_final_timeline(laughter_timeline,person_timeline,max_length=None): if length/shot_length > 0.35: person_interest = (length/shot_length - 0.3)/0.4 total_interest = laugh_len*3 + laugh_db*2 + person_interest*1 - final.append((round(start-5,2),end,round(total_interest,2),round(length/shot_length,3), shot_length)) + final.append((round(start-5,2),end,round(total_interest,2),round(length/shot_length,3), shot_length+5)) total_length += shot_length else: if length/shot_length > 0.30: person_interest = (length/shot_length - 0.3)/0.4 total_interest = laugh_len*3 + laugh_db*2 + person_interest*1 - final.append((round(start-5,2),end,round(total_interest,2),round(length/shot_length,3), shot_length)) + final.append((round(start-5,2),end,round(total_interest,2),round(length/shot_length,3), shot_length+5)) total_length += shot_length # max_length 넘어가는 경우 흥미도 높은 순서로 max_length 이내로 선택 From 7829b3e9cce31c55e586968fce38088c0a008bd2 Mon Sep 17 00:00:00 2001 From: seungriyou Date: Fri, 10 Jun 2022 06:32:05 +0000 Subject: [PATCH 4/4] [Fix] Modify height condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 실험 결과가 재현되지 않는 문제점을 해결하기 위해 height 조건을 수정하였습니다. issue #98 --- model/recognition/face_recog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/recognition/face_recog.py b/model/recognition/face_recog.py index 2b2492f..cff9d56 100644 --- a/model/recognition/face_recog.py +++ b/model/recognition/face_recog.py @@ -127,7 +127,7 @@ def recognize_faces(self): last_original_frame = last_original_frame[:, :, ::-1] height, width = last_original_frame.shape[:2] last_original_frame = last_original_frame[int(height*0.2):, int(width*0.2):int(width*0.8)] - if height > 600: + if height > 800: last_original_frame = cv2.resize(last_original_frame, None, fx=0.6, fy=0.6) frames.append(last_original_frame) frames_real_time.append(frame_num-1) @@ -135,7 +135,7 @@ def recognize_faces(self): start_original_frame = start_original_frame[:, :, ::-1] height, width = start_original_frame.shape[:2] start_original_frame = start_original_frame[int(height*0.2):, int(width*0.2):int(width*0.8)] - if height > 600: + if height > 800: start_original_frame = cv2.resize(start_original_frame, None, fx=0.6, fy=0.6) frames.append(start_original_frame) frames_real_time.append(frame_num)