Update app.py
Browse files
app.py
CHANGED
|
@@ -172,110 +172,6 @@ def get_custom_css():
|
|
| 172 |
width: 100%;
|
| 173 |
}
|
| 174 |
|
| 175 |
-
/* Header styling - logo and text in same line */
|
| 176 |
-
.company-header {
|
| 177 |
-
background: var(--background-fill-primary);
|
| 178 |
-
padding: 25px;
|
| 179 |
-
margin-bottom: 25px;
|
| 180 |
-
text-align: center;
|
| 181 |
-
width: 100%;
|
| 182 |
-
display: flex;
|
| 183 |
-
align-items: center;
|
| 184 |
-
justify-content: center;
|
| 185 |
-
gap: 25px;
|
| 186 |
-
flex-wrap: wrap;
|
| 187 |
-
}
|
| 188 |
-
|
| 189 |
-
.header-logo {
|
| 190 |
-
flex-shrink: 0;
|
| 191 |
-
}
|
| 192 |
-
|
| 193 |
-
.header-logo img {
|
| 194 |
-
width: 140px;
|
| 195 |
-
height: auto;
|
| 196 |
-
}
|
| 197 |
-
|
| 198 |
-
.header-text {
|
| 199 |
-
text-align: center;
|
| 200 |
-
}
|
| 201 |
-
|
| 202 |
-
.header-text h1 {
|
| 203 |
-
font-size: 2.4em !important;
|
| 204 |
-
margin-bottom: 12px;
|
| 205 |
-
font-weight: 700;
|
| 206 |
-
margin-top: 0;
|
| 207 |
-
color: var(--body-text-color);
|
| 208 |
-
}
|
| 209 |
-
|
| 210 |
-
.header-text p {
|
| 211 |
-
font-size: 1.3em !important;
|
| 212 |
-
margin-bottom: 0;
|
| 213 |
-
color: var(--body-text-color);
|
| 214 |
-
opacity: 0.8;
|
| 215 |
-
}
|
| 216 |
-
|
| 217 |
-
/* About section layout */
|
| 218 |
-
.about-section {
|
| 219 |
-
width: 100%;
|
| 220 |
-
margin-bottom: 25px;
|
| 221 |
-
}
|
| 222 |
-
|
| 223 |
-
.about-content {
|
| 224 |
-
display: flex;
|
| 225 |
-
gap: 25px;
|
| 226 |
-
width: 100%;
|
| 227 |
-
}
|
| 228 |
-
|
| 229 |
-
.features-section {
|
| 230 |
-
flex: 0.6;
|
| 231 |
-
padding: 25px;
|
| 232 |
-
background: var(--background-fill-secondary);
|
| 233 |
-
border-radius: 10px;
|
| 234 |
-
font-size: 1.05em !important;
|
| 235 |
-
}
|
| 236 |
-
|
| 237 |
-
.demo-items-section {
|
| 238 |
-
flex: 0.4;
|
| 239 |
-
padding: 10px;
|
| 240 |
-
background: var(--background-fill-secondary);
|
| 241 |
-
border-radius: 10px;
|
| 242 |
-
}
|
| 243 |
-
|
| 244 |
-
.demo-items-grid {
|
| 245 |
-
display: grid;
|
| 246 |
-
grid-template-columns: repeat(2, 1fr);
|
| 247 |
-
gap: 15px;
|
| 248 |
-
}
|
| 249 |
-
|
| 250 |
-
.demo-item {
|
| 251 |
-
background: var(--background-fill-primary);
|
| 252 |
-
padding: 4px;
|
| 253 |
-
border-radius: 8px;
|
| 254 |
-
text-align: center;
|
| 255 |
-
transition: background-color 0.2s ease;
|
| 256 |
-
display: flex;
|
| 257 |
-
flex-direction: column;
|
| 258 |
-
align-items: center;
|
| 259 |
-
justify-content: center;
|
| 260 |
-
text-decoration: none;
|
| 261 |
-
color: var(--body-text-color);
|
| 262 |
-
font-size: 1em !important;
|
| 263 |
-
}
|
| 264 |
-
|
| 265 |
-
.demo-item:hover {
|
| 266 |
-
background: var(--button-secondary-background-fill-hover);
|
| 267 |
-
}
|
| 268 |
-
|
| 269 |
-
.demo-item img {
|
| 270 |
-
height: 30px;
|
| 271 |
-
margin-bottom: 10px;
|
| 272 |
-
}
|
| 273 |
-
|
| 274 |
-
.demo-item span {
|
| 275 |
-
font-size: 0.95em !important;
|
| 276 |
-
font-weight: 600;
|
| 277 |
-
}
|
| 278 |
-
|
| 279 |
/* Main content layout */
|
| 280 |
.main-content-row {
|
| 281 |
display: flex;
|
|
@@ -608,93 +504,12 @@ with gr.Blocks(
|
|
| 608 |
title="MiniAiLive - Face Recognition WebAPI Playground",
|
| 609 |
theme=gr.themes.Glass(),
|
| 610 |
css=get_custom_css()
|
| 611 |
-
) as demo:
|
| 612 |
-
|
| 613 |
with gr.Column(elem_classes="container"):
|
| 614 |
-
# Header Section - Logo and text in same line, centered
|
| 615 |
-
gr.HTML("""
|
| 616 |
-
<div class="company-header">
|
| 617 |
-
<div class="header-logo">
|
| 618 |
-
<img src="https://miniai.live/wp-content/uploads/2024/02/logo_name-1-768x426-1.png" alt="MiniAiLive Logo">
|
| 619 |
-
</div>
|
| 620 |
-
<div class="header-text">
|
| 621 |
-
<h1>MiniAiLive Face Recognition WebAPI Playground</h1>
|
| 622 |
-
<p>Experience our NIST FRVT Top Ranked 1:1 & 1:N Face Matching Technology</p>
|
| 623 |
-
</div>
|
| 624 |
-
</div>
|
| 625 |
-
""")
|
| 626 |
-
|
| 627 |
-
# About Section with Features and Demo Items
|
| 628 |
-
with gr.Column(elem_classes="about-section"):
|
| 629 |
-
with gr.Row(elem_classes="about-content"):
|
| 630 |
-
# Features Section (60%)
|
| 631 |
-
with gr.Column(scale=0.6, elem_classes="features-section"):
|
| 632 |
-
gr.Markdown("""
|
| 633 |
-
**MiniAiLive** is a leading provider of cutting-edge face recognition and liveness detection solutions.
|
| 634 |
-
Our technology is **NIST FRVT Top Ranked** for Face Recognition.
|
| 635 |
-
|
| 636 |
-
### 🏆 Key Features:
|
| 637 |
-
- **NIST FRVT Top Ranked** Top Accuracy in both 1:1 & 1:N Face Matching Technology
|
| 638 |
-
- **Real-time** Face Matching & Verification
|
| 639 |
-
- **On-Premise** Offers complete data control and privacy
|
| 640 |
-
- **On-Device, Offline** Runs on machine. No internet connection is required.
|
| 641 |
-
- **Cross-Platform Support** Supports Windows, Linux, Android & iOS
|
| 642 |
-
- **Free Service** Completely free to use, Free technical support & update
|
| 643 |
-
|
| 644 |
-
[Visit our website](https://miniai.live) to explore our complete suite of AI solutions!
|
| 645 |
-
""")
|
| 646 |
-
|
| 647 |
-
# Demo Items Section (40%)
|
| 648 |
-
with gr.Column(scale=0.4, elem_classes="demo-items-section"):
|
| 649 |
-
with gr.Column(elem_classes="demo-items-grid"):
|
| 650 |
-
gr.HTML("""
|
| 651 |
-
<a href="https://github.com/MiniAiLive" target="_blank" class="demo-item">
|
| 652 |
-
<img src="https://miniai.live/wp-content/uploads/2024/10/new_git-1-300x67.png" alt="GitHub">
|
| 653 |
-
<span>GitHub</span>
|
| 654 |
-
</a>
|
| 655 |
-
""")
|
| 656 |
-
|
| 657 |
-
gr.HTML("""
|
| 658 |
-
<a href="https://huggingface.co/MiniAiLive" target="_blank" class="demo-item">
|
| 659 |
-
<img src="https://miniai.live/wp-content/uploads/2024/10/new_hugging-1-300x67.png" alt="HuggingFace">
|
| 660 |
-
<span>HuggingFace</span>
|
| 661 |
-
</a>
|
| 662 |
-
""")
|
| 663 |
-
|
| 664 |
-
gr.HTML("""
|
| 665 |
-
<a href="https://demo.miniai.live" target="_blank" class="demo-item">
|
| 666 |
-
<img src="https://miniai.live/wp-content/uploads/2024/10/new_gradio-300x67.png" alt="Gradio">
|
| 667 |
-
<span>Live Demo</span>
|
| 668 |
-
</a>
|
| 669 |
-
""")
|
| 670 |
-
|
| 671 |
-
gr.HTML("""
|
| 672 |
-
<a href="https://docs.miniai.live/" target="_blank" class="demo-item">
|
| 673 |
-
<img src="https://miniai.live/wp-content/uploads/2024/10/a-300x70.png" alt="Documentation">
|
| 674 |
-
<span>Documentation</span>
|
| 675 |
-
</a>
|
| 676 |
-
""")
|
| 677 |
-
|
| 678 |
-
gr.HTML("""
|
| 679 |
-
<a href="https://www.youtube.com/@miniailive" target="_blank" class="demo-item">
|
| 680 |
-
<img src="https://miniai.live/wp-content/uploads/2024/10/Untitled-1-300x70.png" alt="YouTube">
|
| 681 |
-
<span>YouTube</span>
|
| 682 |
-
</a>
|
| 683 |
-
""")
|
| 684 |
-
|
| 685 |
-
gr.HTML("""
|
| 686 |
-
<a href="https://play.google.com/store/apps/dev?id=5831076207730531667" target="_blank" class="demo-item">
|
| 687 |
-
<img src="https://miniai.live/wp-content/uploads/2024/10/googleplay-300x62.png" alt="Google Play">
|
| 688 |
-
<span>Google Play</span>
|
| 689 |
-
</a>
|
| 690 |
-
""")
|
| 691 |
-
|
| 692 |
# Main Content - Upload and Results
|
| 693 |
with gr.Row(elem_classes="main-content-row"):
|
| 694 |
# Upload Section
|
| 695 |
with gr.Column(scale=0.6, elem_classes="upload-section"):
|
| 696 |
-
gr.Markdown("### 1. Upload Images for Comparison", elem_classes="section-title")
|
| 697 |
-
|
| 698 |
with gr.Row(elem_classes="upload-images-row"):
|
| 699 |
# First Image
|
| 700 |
with gr.Column(scale=1, elem_classes="upload-image-col"):
|
|
@@ -746,7 +561,6 @@ with gr.Blocks(
|
|
| 746 |
|
| 747 |
# Results Section
|
| 748 |
with gr.Column(scale=0.4, elem_classes="result-section"):
|
| 749 |
-
gr.Markdown("### 2. Comparison Results", elem_classes="section-title")
|
| 750 |
txt_compare_out = gr.HTML(
|
| 751 |
value="<div style='text-align: center; padding: 40px; font-size: 1.1em;'>Results will appear here after comparison</div>"
|
| 752 |
)
|
|
@@ -758,16 +572,6 @@ with gr.Blocks(
|
|
| 758 |
outputs=txt_compare_out
|
| 759 |
)
|
| 760 |
|
| 761 |
-
# Visitor Counter
|
| 762 |
-
gr.HTML("""
|
| 763 |
-
<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2FMiniAiLive%2FFaceRecognition-LivenessDetection-Demo">
|
| 764 |
-
<img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2FMiniAiLive%2FFaceRecognition-LivenessDetection-Demo&label=VISITORS&labelColor=%2337d67a&countColor=%23ff8a65&style=plastic&labelStyle=none" />
|
| 765 |
-
</a>
|
| 766 |
-
""")
|
| 767 |
-
|
| 768 |
-
# Footer
|
| 769 |
-
gr.HTML(create_footer())
|
| 770 |
-
|
| 771 |
if __name__ == "__main__":
|
| 772 |
demo.launch(
|
| 773 |
share=False,
|
|
|
|
| 172 |
width: 100%;
|
| 173 |
}
|
| 174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
/* Main content layout */
|
| 176 |
.main-content-row {
|
| 177 |
display: flex;
|
|
|
|
| 504 |
title="MiniAiLive - Face Recognition WebAPI Playground",
|
| 505 |
theme=gr.themes.Glass(),
|
| 506 |
css=get_custom_css()
|
| 507 |
+
) as demo:
|
|
|
|
| 508 |
with gr.Column(elem_classes="container"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 509 |
# Main Content - Upload and Results
|
| 510 |
with gr.Row(elem_classes="main-content-row"):
|
| 511 |
# Upload Section
|
| 512 |
with gr.Column(scale=0.6, elem_classes="upload-section"):
|
|
|
|
|
|
|
| 513 |
with gr.Row(elem_classes="upload-images-row"):
|
| 514 |
# First Image
|
| 515 |
with gr.Column(scale=1, elem_classes="upload-image-col"):
|
|
|
|
| 561 |
|
| 562 |
# Results Section
|
| 563 |
with gr.Column(scale=0.4, elem_classes="result-section"):
|
|
|
|
| 564 |
txt_compare_out = gr.HTML(
|
| 565 |
value="<div style='text-align: center; padding: 40px; font-size: 1.1em;'>Results will appear here after comparison</div>"
|
| 566 |
)
|
|
|
|
| 572 |
outputs=txt_compare_out
|
| 573 |
)
|
| 574 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 575 |
if __name__ == "__main__":
|
| 576 |
demo.launch(
|
| 577 |
share=False,
|