spuun commited on
Commit
c7dac6a
·
verified ·
1 Parent(s): d097e36

fix: update paths

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -22,11 +22,10 @@ set_seed(42)
22
 
23
  flag = os.environ["FLAG"] if "FLAG" in os.environ else "fakeflag{placeholder}"
24
 
25
- # Load both reference images
26
  ssim_reference_url = "https://files.catbox.moe/b6p5fj.png"
27
  face_reference_url = "https://files.catbox.moe/m0g0ek.png"
28
- ssim_reference_path = "ssim_reference.jpeg"
29
- face_reference_path = "face_reference.jpg"
30
 
31
  # Download SSIM reference
32
  if not os.path.exists(ssim_reference_path):
@@ -82,8 +81,7 @@ def predict_and_compare(image):
82
  distance = result["distance"]
83
 
84
  # Get face area for SSIM
85
- face_detector = DeepFace.build_model('retinaface')
86
- face_area = DeepFace.extract_faces(np.array(image), detector_backend='retinaface')[0]
87
 
88
  # Calculate SSIM against SSIM reference
89
  ssim_value = compare_face_ssim(image, ssim_reference, face_area)
 
22
 
23
  flag = os.environ["FLAG"] if "FLAG" in os.environ else "fakeflag{placeholder}"
24
 
 
25
  ssim_reference_url = "https://files.catbox.moe/b6p5fj.png"
26
  face_reference_url = "https://files.catbox.moe/m0g0ek.png"
27
+ ssim_reference_path = "ssim_reference.png"
28
+ face_reference_path = "face_reference.png"
29
 
30
  # Download SSIM reference
31
  if not os.path.exists(ssim_reference_path):
 
81
  distance = result["distance"]
82
 
83
  # Get face area for SSIM
84
+ face_area = DeepFace.extract_faces(temp_path, detector_backend='retinaface')[0]
 
85
 
86
  # Calculate SSIM against SSIM reference
87
  ssim_value = compare_face_ssim(image, ssim_reference, face_area)