edreesi commited on
Commit
3229779
·
verified ·
1 Parent(s): e1f071d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -111,15 +111,22 @@ def check_liveness(frame):
111
  if 'data' in json_result:
112
  data = json_result['data']
113
  print("the result data is is",data)
114
- if data.IsLive :
115
- liveness_result = f"""<div class="markdown-success-container"><p style="text-align: center; font-size: 20px; color: green;">Liveness Check: GENUINE</p></div>"""
116
- json_output = {"Is Live": "Failed" if data.IsLive else "Success",
117
- "document Type": data.DocumentType,
 
 
 
 
 
 
 
 
118
  # "Printed Cutout Check": "Failed" if printedCopy < printedCopyThreshold else "Success"
119
  }
120
  # Update json_result with the modified process_results
121
  return [liveness_result, json_output]
122
-
123
  liveness_result = f"""<div class="markdown-fail-container"><p style="text-align: center; font-size: 20px; color: red;">Liveness Check Failed</p></div>"""
124
  return [liveness_result, {"status": "error", "result": "document not found!"}]
125
  else:
 
111
  if 'data' in json_result:
112
  data = json_result['data']
113
  print("the result data is is",data)
114
+ if data["IsLive"] :
115
+ liveness_result = f"""<div class="markdown-success-container"><p style="text-align: center; font-size: 20px; color: green;">Liveness Check: Live </p></div>"""
116
+ json_output = {"Is Live": "Success",
117
+ "document Type": data["DocumentType"],
118
+ # "Printed Cutout Check": "Failed" if printedCopy < printedCopyThreshold else "Success"
119
+ }
120
+ # Update json_result with the modified process_results
121
+ return [liveness_result, json_output]
122
+ else:
123
+ liveness_result = f"""<div class="markdown-success-container"><p style="text-align: center; font-size: 20px; color: green;">Liveness Check: Fake</p></div>"""
124
+ json_output = {"Is Live": "Failed",
125
+ "document Type": data["DocumentType"],
126
  # "Printed Cutout Check": "Failed" if printedCopy < printedCopyThreshold else "Success"
127
  }
128
  # Update json_result with the modified process_results
129
  return [liveness_result, json_output]
 
130
  liveness_result = f"""<div class="markdown-fail-container"><p style="text-align: center; font-size: 20px; color: red;">Liveness Check Failed</p></div>"""
131
  return [liveness_result, {"status": "error", "result": "document not found!"}]
132
  else: