NeeravS commited on
Commit
3a3c2be
·
verified ·
1 Parent(s): d366f95

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -1,15 +1,20 @@
 
1
  import gradio as gr
2
- from app import DeepfakeAnalyzer # Import your backend code
 
 
 
 
 
 
 
3
 
4
  # Initialize the analyzer instance
5
  analyzer = DeepfakeAnalyzer()
6
 
7
- # Define the Gradio function to analyze the video and return detailed results
8
  def analyze_video(video_file):
9
- # Run the analyzer on the video file
10
  results = analyzer.analyze_media(video_file)
11
-
12
- # Prepare detailed results
13
  combined_probability = results['combined_assessment']
14
  audio_analysis = results["audio_analysis"]
15
  video_probability = results['video_analysis']['probability']
@@ -43,7 +48,7 @@ interface = gr.Interface(
43
  inputs=gr.Video(label="Upload Video"),
44
  outputs="json",
45
  title="Deepfake Analyzer",
46
- description="Upload a video to analyze for deepfake content. The analyzer provides audio and video analysis results."
47
  )
48
 
49
  # Launch Gradio app
 
1
+ import os
2
  import gradio as gr
3
+
4
+ # Clone the GitHub repository containing app.py if not already cloned
5
+ REPO_URL = "https://github.com/NeeravSood/AllMark-MVP" # Replace with your GitHub repo URL
6
+ if not os.path.exists("AllMark-MVP"): # Replace with your repo's folder name
7
+ os.system(f"git clone {REPO_URL}")
8
+
9
+ # Import the backend code after cloning the repo
10
+ from repository_name.app import DeepfakeAnalyzer # Adjust based on your repo and file structure
11
 
12
  # Initialize the analyzer instance
13
  analyzer = DeepfakeAnalyzer()
14
 
15
+ # Define the function for Gradio to call
16
  def analyze_video(video_file):
 
17
  results = analyzer.analyze_media(video_file)
 
 
18
  combined_probability = results['combined_assessment']
19
  audio_analysis = results["audio_analysis"]
20
  video_probability = results['video_analysis']['probability']
 
48
  inputs=gr.Video(label="Upload Video"),
49
  outputs="json",
50
  title="Deepfake Analyzer",
51
+ description="Upload a video to analyze for deepfake content."
52
  )
53
 
54
  # Launch Gradio app