File size: 1,790 Bytes
23975eb
9f5d208
43b429f
 
 
9f5d208
43b429f
9f5d208
43b429f
8552331
43b429f
 
8552331
43b429f
9f5d208
8552331
43b429f
 
8552331
43b429f
 
8552331
43b429f
 
8552331
43b429f
 
8552331
 
43b429f
23975eb
43b429f
 
 
 
 
8552331
43b429f
 
 
 
 
9f5d208
43b429f
9f5d208
43b429f
 
 
9f5d208
43b429f
9f5d208
43b429f
 
9f5d208
43b429f
 
8552331
43b429f
9f5d208
43b429f
 
 
 
23975eb
43b429f
 
8552331
43b429f
 
 
23975eb
9f5d208
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import gradio as gr

from prog.image import detect_image
from prog.audio import detect_audio
from prog.video import detect_video

print(" DeepGuard Premium UI Running...")

def detect(file):

    if file is None:
        return " Please upload a file"

    name = file.name.lower()

    try:
        if name.endswith((".jpg", ".jpeg", ".png")):
            return detect_image(file.name)

        elif name.endswith((".wav", ".mp3", ".ogg")):
            return detect_audio(file.name)

        elif name.endswith((".mp4", ".avi", ".mov")):
            return detect_video(file.name)

        else:
            return " Unsupported file format"

    except Exception as e:
        return f"Error: {str(e)}"

with gr.Blocks(theme=gr.themes.Soft(), css="""
body {background: #0f172a;}
.card {border-radius: 12px; padding: 15px; background: #1e293b;}
.result {font-size: 18px; font-weight: bold;}
""") as demo:

    # HEADER
    gr.Markdown("""
      DeepGuard AI
     Multi-Modal Deepfake Detection System
    """)

    with gr.Row():

        # LEFT PANEL
        with gr.Column(scale=1):
            gr.Markdown(" Upload File")

            file_input = gr.File(label="Upload Image / Audio / Video")

            analyze_btn = gr.Button(" Analyze", variant="primary")
            clear_btn = gr.Button("Clear")

        # RIGHT PANEL
        with gr.Column(scale=2):

            gr.Markdown(" Result")

            output = gr.Textbox(
                label="Detection Output",
                lines=10
            )

    # FOOTER
    gr.Markdown("This system uses AI predictions and may not be 100% accurate.")

    # BUTTON ACTIONS
    analyze_btn.click(detect, inputs=file_input, outputs=output)
    clear_btn.click(lambda: "", None, output)
if __name__ == "__main__":
    demo.launch()