Spaces:
Runtime error
Runtime error
File size: 1,281 Bytes
40b00b3 | 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 | import streamlit as st
def render_header():
st.markdown("<h1>Deepfake Image Detector</h1>", unsafe_allow_html=True)
st.markdown("<p class='subtitle'>Select or drag an image below to analyze it.</p>", unsafe_allow_html=True)
def render_result(is_fake, confidence_percentage):
if is_fake:
box_class = "result-box-fake"
display_label = "AI-Generated (Fake)"
color_fill = "#8b5cf6"
else:
box_class = "result-box-real"
display_label = "Authentic (Real)"
color_fill = "#7dd3fc"
st.balloons()
html_result = f"""
<div class='{box_class}'>
<h3 style="color: #fff; margin-bottom: 5px;">Result: {display_label}</h3>
<div class='confidence'>
Confidence: {confidence_percentage}%
<div class='confidence-bar-container'>
<div class='confidence-bar-fill' style='width: {confidence_percentage}%; background: linear-gradient(90deg, #7dd3fc, #8b5cf6);'></div>
</div>
</div>
</div>
"""
st.markdown(html_result, unsafe_allow_html=True)
def render_footer():
st.markdown("<div style='margin-top: 20px; font-size: 0.8em; color: #777; text-align: center;'>Powered by Deep Learning • v1.0</div>", unsafe_allow_html=True)
|