noumanjavaid commited on
Commit
d9adb99
·
verified ·
1 Parent(s): 734d75e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  import streamlit as st
2
  from PIL import Image, ImageDraw, ImageFont, ExifTags
3
  import requests
@@ -5,7 +7,8 @@ from io import BytesIO
5
  import cv2
6
  import numpy as np
7
  import pandas as pd
8
- import fitz # PyMuPDF for PDF handling = jls_extract_def()
 
9
  import docx # For handling Word documents
10
  from difflib import HtmlDiff, SequenceMatcher # For text comparison
11
  import os
@@ -13,7 +16,7 @@ import logging
13
  import base64
14
  import zipfile
15
  from typing import Dict
16
- # from deepface import DeepFace # For deepfake detection
17
  import pytesseract # For OCR in watermark detection
18
 
19
  # Page configuration with custom theme
@@ -348,7 +351,7 @@ def nvidia_deepfake_detection_app():
348
  )
349
 
350
  # Risk assessment
351
- if is_deepfake or confidence > 90:
352
  st.error("🚨 HIGH RISK: Likely a Deepfake")
353
  elif confidence > 70:
354
  st.warning("⚠️ MODERATE RISK: Potential Deepfake")
@@ -716,4 +719,4 @@ def main():
716
  document_comparison_tool()
717
 
718
  if __name__ == "__main__":
719
- main()
 
1
+ # File: app.py
2
+
3
  import streamlit as st
4
  from PIL import Image, ImageDraw, ImageFont, ExifTags
5
  import requests
 
7
  import cv2
8
  import numpy as np
9
  import pandas as pd
10
+ from skimage.metrics import structural_similarity as ssim
11
+ import fitz # PyMuPDF for PDF handling
12
  import docx # For handling Word documents
13
  from difflib import HtmlDiff, SequenceMatcher # For text comparison
14
  import os
 
16
  import base64
17
  import zipfile
18
  from typing import Dict
19
+ from deepface import DeepFace # For deepfake detection
20
  import pytesseract # For OCR in watermark detection
21
 
22
  # Page configuration with custom theme
 
351
  )
352
 
353
  # Risk assessment
354
+ if is_deepfake > 90:
355
  st.error("🚨 HIGH RISK: Likely a Deepfake")
356
  elif confidence > 70:
357
  st.warning("⚠️ MODERATE RISK: Potential Deepfake")
 
719
  document_comparison_tool()
720
 
721
  if __name__ == "__main__":
722
+ main()