Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,29 +1,102 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
css = """
|
4 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
.container {
|
6 |
-
max-width:
|
7 |
margin: 0 auto;
|
8 |
-
padding:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
font-family: 'Arial', sans-serif;
|
14 |
-
color: #2d3748;
|
15 |
}
|
16 |
|
17 |
-
/* Iframe container styles */
|
18 |
.iframe-container {
|
19 |
position: relative;
|
20 |
width: 100%;
|
21 |
height: 0;
|
22 |
-
padding-bottom:
|
23 |
-
background:
|
24 |
-
border-radius: 12px;
|
25 |
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
26 |
-
overflow: hidden;
|
27 |
}
|
28 |
|
29 |
.iframe-container iframe {
|
@@ -33,139 +106,173 @@ h1, h2, h3 {
|
|
33 |
width: 100%;
|
34 |
height: 100%;
|
35 |
border: none;
|
36 |
-
border-radius:
|
37 |
}
|
38 |
|
39 |
-
/*
|
40 |
-
.
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
margin:
|
45 |
-
border-radius: 12px;
|
46 |
-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
47 |
-
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
48 |
}
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
-
.card
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
-
.card
|
65 |
-
|
|
|
|
|
66 |
}
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
margin-top: 20px;
|
71 |
-
padding: 15px;
|
72 |
-
background-color: #f8f9fa;
|
73 |
-
border-radius: 8px;
|
74 |
-
border: 1px solid #e2e8f0;
|
75 |
}
|
76 |
|
77 |
-
.
|
78 |
-
color:
|
79 |
text-decoration: none;
|
80 |
font-weight: 500;
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
-
.
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
height: 50px;
|
91 |
-
margin-bottom: 20px;
|
92 |
}
|
93 |
|
94 |
-
/*
|
95 |
-
.
|
96 |
-
|
97 |
}
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
103 |
}
|
104 |
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
"""
|
120 |
|
121 |
-
with gr.Blocks(css=css) as demo:
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
gr.HTML('''
|
131 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
<a href="https://noumanjavaid-new-space.hf.space" target="_blank">
|
133 |
π DeepFake Detection
|
134 |
</a>
|
135 |
</div>
|
136 |
-
|
|
|
137 |
<a href="https://noumanjavaid-centurionv2.hf.space" target="_blank">
|
138 |
-
π
|
139 |
</a>
|
140 |
</div>
|
141 |
-
|
142 |
-
|
143 |
-
with gr.Column(scale=2, elem_classes=["column"]):
|
144 |
-
gr.HTML('''
|
145 |
-
<div class="iframe-container">
|
146 |
-
<iframe src="https://noumanjavaid-centii.hf.space"></iframe>
|
147 |
-
</div>
|
148 |
-
''')
|
149 |
-
|
150 |
-
with gr.Column(elem_classes=["column"]):
|
151 |
-
gr.Markdown("### Additional Tools", elem_classes=["section-title"])
|
152 |
-
gr.HTML('''
|
153 |
-
<div class="card">
|
154 |
<a href="https://noumanjavaid-watermark-demo-video.hf.space" target="_blank">
|
155 |
π₯ Video Watermarking
|
156 |
</a>
|
157 |
</div>
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
161 |
</a>
|
162 |
</div>
|
163 |
''')
|
164 |
-
|
165 |
-
with gr.Row(elem_classes=["fallback-link"]):
|
166 |
-
gr.Markdown("""
|
167 |
-
βΉοΈ If the Deepfake Detector is not loading, please [click here](https://noumanjavaid-new-space.hf.space) to access it directly.
|
168 |
-
""")
|
169 |
|
170 |
if __name__ == "__main__":
|
171 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
css = """
|
4 |
+
/* Modern theme with cool effects */
|
5 |
+
:root {
|
6 |
+
--primary-black: #000000;
|
7 |
+
--primary-white: #ffffff;
|
8 |
+
--gray-100: #f7f7f7;
|
9 |
+
--gray-200: #e5e5e5;
|
10 |
+
--gray-300: #d4d4d4;
|
11 |
+
--gray-400: #a3a3a3;
|
12 |
+
--gray-800: #262626;
|
13 |
+
--gray-900: #171717;
|
14 |
+
}
|
15 |
+
|
16 |
+
* {
|
17 |
+
margin: 0;
|
18 |
+
padding: 0;
|
19 |
+
box-sizing: border-box;
|
20 |
+
}
|
21 |
+
|
22 |
+
body {
|
23 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
24 |
+
background-color: var(--primary-black);
|
25 |
+
color: var(--primary-white);
|
26 |
+
}
|
27 |
+
|
28 |
+
/* Glassmorphism Header */
|
29 |
+
.header {
|
30 |
+
background: rgba(23, 23, 23, 0.8);
|
31 |
+
backdrop-filter: blur(10px);
|
32 |
+
-webkit-backdrop-filter: blur(10px);
|
33 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
34 |
+
padding: 1.5rem 2rem;
|
35 |
+
position: sticky;
|
36 |
+
top: 0;
|
37 |
+
z-index: 1000;
|
38 |
+
display: flex;
|
39 |
+
align-items: center;
|
40 |
+
justify-content: space-between;
|
41 |
+
}
|
42 |
+
|
43 |
+
.logo-container {
|
44 |
+
display: flex;
|
45 |
+
align-items: center;
|
46 |
+
gap: 1rem;
|
47 |
+
}
|
48 |
+
|
49 |
+
.logo {
|
50 |
+
width: 45px;
|
51 |
+
height: 45px;
|
52 |
+
filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
|
53 |
+
transition: transform 0.3s ease;
|
54 |
+
}
|
55 |
+
|
56 |
+
.logo:hover {
|
57 |
+
transform: scale(1.1);
|
58 |
+
}
|
59 |
+
|
60 |
+
.header-title {
|
61 |
+
color: var(--primary-white);
|
62 |
+
font-size: 28px;
|
63 |
+
font-weight: 600;
|
64 |
+
text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
|
65 |
+
}
|
66 |
+
|
67 |
+
/* Main container with cool gradient */
|
68 |
.container {
|
69 |
+
max-width: 1400px;
|
70 |
margin: 0 auto;
|
71 |
+
padding: 2rem;
|
72 |
+
background: linear-gradient(
|
73 |
+
135deg,
|
74 |
+
rgba(38, 38, 38, 0.9) 0%,
|
75 |
+
rgba(23, 23, 23, 0.9) 100%
|
76 |
+
);
|
77 |
+
}
|
78 |
+
|
79 |
+
/* Modern Iframe container */
|
80 |
+
.main-content {
|
81 |
+
background: var(--gray-900);
|
82 |
+
border-radius: 20px;
|
83 |
+
box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
|
84 |
+
margin: 2rem 0;
|
85 |
+
overflow: hidden;
|
86 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
87 |
+
transition: transform 0.3s ease;
|
88 |
}
|
89 |
|
90 |
+
.main-content:hover {
|
91 |
+
transform: translateY(-5px);
|
|
|
|
|
92 |
}
|
93 |
|
|
|
94 |
.iframe-container {
|
95 |
position: relative;
|
96 |
width: 100%;
|
97 |
height: 0;
|
98 |
+
padding-bottom: 65%;
|
99 |
+
background: var(--gray-900);
|
|
|
|
|
|
|
100 |
}
|
101 |
|
102 |
.iframe-container iframe {
|
|
|
106 |
width: 100%;
|
107 |
height: 100%;
|
108 |
border: none;
|
109 |
+
border-radius: 20px;
|
110 |
}
|
111 |
|
112 |
+
/* Modern Navigation Grid */
|
113 |
+
.nav-grid {
|
114 |
+
display: grid;
|
115 |
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
116 |
+
gap: 1.5rem;
|
117 |
+
margin-top: 2rem;
|
|
|
|
|
|
|
118 |
}
|
119 |
|
120 |
+
/* Sleek Navigation Cards */
|
121 |
+
.nav-card {
|
122 |
+
background: rgba(38, 38, 38, 0.5);
|
123 |
+
backdrop-filter: blur(10px);
|
124 |
+
-webkit-backdrop-filter: blur(10px);
|
125 |
+
border-radius: 15px;
|
126 |
+
padding: 1.5rem;
|
127 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
128 |
+
transition: all 0.3s ease;
|
129 |
+
position: relative;
|
130 |
+
overflow: hidden;
|
131 |
}
|
132 |
|
133 |
+
.nav-card::before {
|
134 |
+
content: '';
|
135 |
+
position: absolute;
|
136 |
+
top: 0;
|
137 |
+
left: 0;
|
138 |
+
width: 100%;
|
139 |
+
height: 100%;
|
140 |
+
background: linear-gradient(
|
141 |
+
45deg,
|
142 |
+
transparent 0%,
|
143 |
+
rgba(255, 255, 255, 0.05) 50%,
|
144 |
+
transparent 100%
|
145 |
+
);
|
146 |
+
transform: translateX(-100%);
|
147 |
+
transition: transform 0.6s ease;
|
148 |
}
|
149 |
|
150 |
+
.nav-card:hover {
|
151 |
+
transform: translateY(-5px) scale(1.02);
|
152 |
+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
|
153 |
+
background: rgba(38, 38, 38, 0.8);
|
154 |
}
|
155 |
|
156 |
+
.nav-card:hover::before {
|
157 |
+
transform: translateX(100%);
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
+
.nav-card a {
|
161 |
+
color: var(--primary-white);
|
162 |
text-decoration: none;
|
163 |
font-weight: 500;
|
164 |
+
font-size: 1.1rem;
|
165 |
+
display: flex;
|
166 |
+
align-items: center;
|
167 |
+
gap: 0.8rem;
|
168 |
+
position: relative;
|
169 |
}
|
170 |
|
171 |
+
.nav-card a::after {
|
172 |
+
content: 'β';
|
173 |
+
position: absolute;
|
174 |
+
right: 0;
|
175 |
+
opacity: 0;
|
176 |
+
transform: translateX(-10px);
|
177 |
+
transition: all 0.3s ease;
|
178 |
}
|
179 |
|
180 |
+
.nav-card:hover a::after {
|
181 |
+
opacity: 1;
|
182 |
+
transform: translateX(0);
|
|
|
|
|
183 |
}
|
184 |
|
185 |
+
/* Hide Gradio elements */
|
186 |
+
footer, .gradio-container {
|
187 |
+
display: none !important;
|
188 |
}
|
189 |
|
190 |
+
/* Cool loading animation */
|
191 |
+
@keyframes pulse {
|
192 |
+
0% { opacity: 0.5; }
|
193 |
+
50% { opacity: 1; }
|
194 |
+
100% { opacity: 0.5; }
|
195 |
}
|
196 |
|
197 |
+
.loading {
|
198 |
+
animation: pulse 1.5s infinite;
|
199 |
+
}
|
200 |
+
|
201 |
+
/* Modern scrollbar */
|
202 |
+
::-webkit-scrollbar {
|
203 |
+
width: 8px;
|
204 |
+
height: 8px;
|
205 |
+
}
|
206 |
+
|
207 |
+
::-webkit-scrollbar-track {
|
208 |
+
background: var(--gray-900);
|
209 |
+
}
|
210 |
+
|
211 |
+
::-webkit-scrollbar-thumb {
|
212 |
+
background: var(--gray-400);
|
213 |
+
border-radius: 4px;
|
214 |
+
}
|
215 |
+
|
216 |
+
::-webkit-scrollbar-thumb:hover {
|
217 |
+
background: var(--gray-300);
|
218 |
}
|
219 |
"""
|
220 |
|
221 |
+
with gr.Blocks(css=css, title="Centurion Analysis Platform") as demo:
|
222 |
+
# Modern Header
|
223 |
+
with gr.Row(elem_classes=["header"]):
|
224 |
+
with gr.Column(elem_classes=["logo-container"]):
|
225 |
+
gr.Image(
|
226 |
+
"https://raw.githubusercontent.com/noumanjavaid96/ai-as-an-api/refs/heads/master/image%20(39).png",
|
227 |
+
elem_classes=["logo"],
|
228 |
+
show_label=False,
|
229 |
+
container=False
|
230 |
+
)
|
231 |
+
gr.Markdown("Centurion Analysis", elem_classes=["header-title"])
|
232 |
|
233 |
+
# Main Content
|
234 |
+
with gr.Row(elem_classes=["container"]):
|
235 |
+
with gr.Column(elem_classes=["main-content"]):
|
236 |
gr.HTML('''
|
237 |
+
<div class="iframe-container">
|
238 |
+
<iframe src="https://noumanjavaid-centii.hf.space"></iframe>
|
239 |
+
</div>
|
240 |
+
''')
|
241 |
+
|
242 |
+
# Navigation Cards
|
243 |
+
with gr.Row(elem_classes=["nav-grid"]):
|
244 |
+
gr.HTML('''
|
245 |
+
<div class="nav-card">
|
246 |
<a href="https://noumanjavaid-new-space.hf.space" target="_blank">
|
247 |
π DeepFake Detection
|
248 |
</a>
|
249 |
</div>
|
250 |
+
|
251 |
+
<div class="nav-card">
|
252 |
<a href="https://noumanjavaid-centurionv2.hf.space" target="_blank">
|
253 |
+
π Document Analysis
|
254 |
</a>
|
255 |
</div>
|
256 |
+
|
257 |
+
<div class="nav-card">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
<a href="https://noumanjavaid-watermark-demo-video.hf.space" target="_blank">
|
259 |
π₯ Video Watermarking
|
260 |
</a>
|
261 |
</div>
|
262 |
+
|
263 |
+
<div class="nav-card">
|
264 |
+
<a href="https://noumanjavaid-centii.hf.space" target="_blank">
|
265 |
+
π Image Authentication
|
266 |
</a>
|
267 |
</div>
|
268 |
''')
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
if __name__ == "__main__":
|
271 |
+
demo.launch(
|
272 |
+
show_error=True,
|
273 |
+
show_api=False,
|
274 |
+
show_tips=False,
|
275 |
+
height=800,
|
276 |
+
analytics_enabled=False,
|
277 |
+
enable_queue=False
|
278 |
+
)
|