hassan526 commited on
Commit
d76c9ff
·
verified ·
1 Parent(s): bba2e95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -447,7 +447,9 @@ def compare_face(frame1, frame2):
447
  if g_fr_activation_result != 0:
448
  gr.Warning("FR SDK Activation Failed!")
449
  return None, None, None, None
450
-
 
 
451
  try:
452
  image1 = open(frame1, 'rb')
453
  image2 = open(frame2, 'rb')
@@ -458,6 +460,7 @@ def compare_face(frame1, frame2):
458
  image_mat2 = cv2.imdecode(np.frombuffer(image2.read(), np.uint8), cv2.IMREAD_COLOR)
459
  start_time = time.time()
460
  result, score, face_bboxes, face_features = fr_header.compare_face(image_mat1, image_mat2, float(threshold))
 
461
  end_time = time.time()
462
  process_time = (end_time - start_time) * 1000
463
 
 
447
  if g_fr_activation_result != 0:
448
  gr.Warning("FR SDK Activation Failed!")
449
  return None, None, None, None
450
+ else:
451
+ gr.Warning("FR SDK Activation Success!")
452
+
453
  try:
454
  image1 = open(frame1, 'rb')
455
  image2 = open(frame2, 'rb')
 
460
  image_mat2 = cv2.imdecode(np.frombuffer(image2.read(), np.uint8), cv2.IMREAD_COLOR)
461
  start_time = time.time()
462
  result, score, face_bboxes, face_features = fr_header.compare_face(image_mat1, image_mat2, float(threshold))
463
+ gr.Warning(f"{result} {score} {face_bboxes} ")
464
  end_time = time.time()
465
  process_time = (end_time - start_time) * 1000
466