BrainAI-1 commited on
Commit
d40b455
·
verified ·
1 Parent(s): 3de05a3

Update utils/emotion_detection_brainai.py

Browse files
Files changed (1) hide show
  1. utils/emotion_detection_brainai.py +4 -4
utils/emotion_detection_brainai.py CHANGED
@@ -39,17 +39,17 @@ class EmotionModel:
39
 
40
  return input_img
41
 
42
- def detect_faces(self, img, conf = 0.5)
43
  result_face = self.face_compiled_model([input_img])[self.face_output_layer]
44
- boxes = self.post_process_face(result_face, uploaded_img_cv, conf=0.5)
45
 
46
  return boxes
47
 
48
  def post_process_face(self, result_face, img, conf=0.5):
49
  boxes = []
50
  h,w,_ = img.shape
51
- predictions = result_face[0][0] # 하위 집합 데이터 프레임
52
- confidence = predictions[:,2] # conf 값 가져오기 [img_id, label, conf, x_min, y_min, x_max, y_max]
53
 
54
  top_predictions = predictions[(confidence>conf)] # 임계값보다 큰 conf 값을 가진 예측만 선택
55
  for detection in top_predictions:
 
39
 
40
  return input_img
41
 
42
+ def detect_faces(self, img, conf = 0.5):
43
  result_face = self.face_compiled_model([input_img])[self.face_output_layer]
44
+ boxes = self.post_process_face(result_face, uploaded_img_cv, conf)
45
 
46
  return boxes
47
 
48
  def post_process_face(self, result_face, img, conf=0.5):
49
  boxes = []
50
  h,w,_ = img.shape
51
+ result = result_face[0][0] # 하위 집합 데이터 프레임
52
+ confidence = result[:,2] # conf 값 가져오기 [img_id, label, conf, x_min, y_min, x_max, y_max]
53
 
54
  top_predictions = predictions[(confidence>conf)] # 임계값보다 큰 conf 값을 가진 예측만 선택
55
  for detection in top_predictions: