Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +89 -11
templates/index.html
CHANGED
|
@@ -62,10 +62,10 @@
|
|
| 62 |
cursor: pointer;
|
| 63 |
z-index: 10;
|
| 64 |
}
|
|
|
|
| 65 |
.preview-container:hover .delete-btn {
|
| 66 |
opacity: 1;
|
| 67 |
}
|
| 68 |
-
|
| 69 |
|
| 70 |
.loading-overlay {
|
| 71 |
position: fixed;
|
|
@@ -183,11 +183,49 @@
|
|
| 183 |
100% { width: var(--progress-value, 0%); }
|
| 184 |
}
|
| 185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
/* Responsiveness */
|
| 187 |
@media (max-width: 768px) {
|
| 188 |
.preview-container {
|
| 189 |
margin-bottom: 1rem;
|
| 190 |
}
|
|
|
|
|
|
|
|
|
|
| 191 |
}
|
| 192 |
</style>
|
| 193 |
</head>
|
|
@@ -220,6 +258,55 @@
|
|
| 220 |
|
| 221 |
<!-- Contenu principal -->
|
| 222 |
<main class="container mx-auto p-6">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
<div class="grid md:grid-cols-2 gap-8">
|
| 224 |
<!-- Section de capture -->
|
| 225 |
<div class="bg-white rounded-xl shadow-xl p-6 animate__animated animate__fadeInLeft">
|
|
@@ -293,9 +380,8 @@
|
|
| 293 |
|
| 294 |
<!-- Script JavaScript -->
|
| 295 |
<script>
|
| 296 |
-
let uploadedImages = [];
|
| 297 |
|
| 298 |
-
// Gestion de l'upload d'images
|
| 299 |
const fileInput = document.getElementById('fileInput');
|
| 300 |
fileInput.addEventListener('change', handleImageUpload);
|
| 301 |
|
|
@@ -317,21 +403,18 @@
|
|
| 317 |
}
|
| 318 |
}
|
| 319 |
|
| 320 |
-
// Boutons de suppression
|
| 321 |
document.querySelectorAll('.delete-btn').forEach(button => {
|
| 322 |
button.addEventListener('click', function() {
|
| 323 |
const targetPreviewId = this.dataset.target;
|
| 324 |
const targetPreview = document.getElementById(targetPreviewId);
|
| 325 |
targetPreview.style.backgroundImage = '';
|
| 326 |
|
| 327 |
-
// Retirer l'image du tableau uploadedImages
|
| 328 |
uploadedImages = uploadedImages.filter(image => image.preview !== targetPreviewId);
|
| 329 |
|
| 330 |
updateCompareButtonState();
|
| 331 |
});
|
| 332 |
});
|
| 333 |
|
| 334 |
-
// Gestion du bouton de la caméra
|
| 335 |
const cameraBtn = document.getElementById('cameraBtn');
|
| 336 |
const video = document.getElementById('video');
|
| 337 |
let stream = null;
|
|
@@ -356,7 +439,6 @@
|
|
| 356 |
}
|
| 357 |
});
|
| 358 |
|
| 359 |
-
// Capture d'image depuis la caméra
|
| 360 |
video.addEventListener('click', () => {
|
| 361 |
if (stream && uploadedImages.length < 2) {
|
| 362 |
const canvas = document.createElement('canvas');
|
|
@@ -375,7 +457,6 @@
|
|
| 375 |
}
|
| 376 |
});
|
| 377 |
|
| 378 |
-
// Gestion du bouton de comparaison
|
| 379 |
const compareBtn = document.getElementById('compareBtn');
|
| 380 |
compareBtn.addEventListener('click', () => {
|
| 381 |
if (uploadedImages.length === 2) {
|
|
@@ -406,7 +487,6 @@
|
|
| 406 |
compareBtn.classList.toggle('hidden', uploadedImages.length < 2);
|
| 407 |
}
|
| 408 |
|
| 409 |
-
// Affichage des résultats
|
| 410 |
function showResults(data) {
|
| 411 |
const resultsDiv = document.getElementById('results');
|
| 412 |
resultsDiv.classList.remove('show');
|
|
@@ -431,7 +511,6 @@
|
|
| 431 |
</div>
|
| 432 |
`;
|
| 433 |
resultsDiv.classList.add('show');
|
| 434 |
-
// Animer la barre de progression après un court délai
|
| 435 |
setTimeout(() => {
|
| 436 |
const progressBarFill = resultsDiv.querySelector('.progress-bar-fill');
|
| 437 |
progressBarFill.style.width = `${data.similarity}%`;
|
|
@@ -453,7 +532,6 @@
|
|
| 453 |
}, 300);
|
| 454 |
}
|
| 455 |
|
| 456 |
-
// Fonctions pour afficher et masquer le chargement
|
| 457 |
function showLoading() {
|
| 458 |
document.querySelector('.loading-overlay').style.display = 'flex';
|
| 459 |
}
|
|
|
|
| 62 |
cursor: pointer;
|
| 63 |
z-index: 10;
|
| 64 |
}
|
| 65 |
+
|
| 66 |
.preview-container:hover .delete-btn {
|
| 67 |
opacity: 1;
|
| 68 |
}
|
|
|
|
| 69 |
|
| 70 |
.loading-overlay {
|
| 71 |
position: fixed;
|
|
|
|
| 183 |
100% { width: var(--progress-value, 0%); }
|
| 184 |
}
|
| 185 |
|
| 186 |
+
/* Description du projet */
|
| 187 |
+
.project-description {
|
| 188 |
+
background-color: #f9fafb;
|
| 189 |
+
padding: 2rem;
|
| 190 |
+
border-radius: 0.5rem;
|
| 191 |
+
margin-bottom: 2rem;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
.project-description h2 {
|
| 195 |
+
font-size: 1.875rem;
|
| 196 |
+
font-weight: 700;
|
| 197 |
+
color: #374151;
|
| 198 |
+
margin-bottom: 1rem;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
.project-description p {
|
| 202 |
+
font-size: 1rem;
|
| 203 |
+
color: #4b5563;
|
| 204 |
+
line-height: 1.6;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
.project-description ul {
|
| 208 |
+
list-style-type: disc;
|
| 209 |
+
margin-left: 1.5rem;
|
| 210 |
+
color: #4b5563;
|
| 211 |
+
margin-top: 1rem;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
.project-description ul li {
|
| 215 |
+
margin-bottom: 0.5rem;
|
| 216 |
+
}
|
| 217 |
+
.tech-used{
|
| 218 |
+
margin-top: 0.5rem;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
/* Responsiveness */
|
| 222 |
@media (max-width: 768px) {
|
| 223 |
.preview-container {
|
| 224 |
margin-bottom: 1rem;
|
| 225 |
}
|
| 226 |
+
.project-description{
|
| 227 |
+
margin-bottom: 1rem;
|
| 228 |
+
}
|
| 229 |
}
|
| 230 |
</style>
|
| 231 |
</head>
|
|
|
|
| 258 |
|
| 259 |
<!-- Contenu principal -->
|
| 260 |
<main class="container mx-auto p-6">
|
| 261 |
+
<!-- Description du projet -->
|
| 262 |
+
<div class="project-description">
|
| 263 |
+
<h2 class="text-3xl font-bold text-gray-800 mb-4">FaceAI Pro - Reconnaissance Faciale Avancée</h2>
|
| 264 |
+
<p>
|
| 265 |
+
FaceAI Pro est une application web de démonstration qui permet de comparer deux visages et de déterminer leur degré de similarité.
|
| 266 |
+
Elle utilise des technologies de pointe en matière de reconnaissance faciale pour fournir des résultats rapides et précis.
|
| 267 |
+
</p>
|
| 268 |
+
<p>
|
| 269 |
+
Cette application est idéale pour explorer les capacités de la reconnaissance faciale et comprendre son fonctionnement.
|
| 270 |
+
Elle peut être utilisée à des fins de test, d'apprentissage ou de développement.
|
| 271 |
+
</p>
|
| 272 |
+
<h3 class="text-xl font-bold text-gray-800 mt-6 mb-2">Fonctionnalités :</h3>
|
| 273 |
+
<ul>
|
| 274 |
+
<li>Comparaison de deux images contenant des visages.</li>
|
| 275 |
+
<li>Détection automatique des visages dans les images.</li>
|
| 276 |
+
<li>Calcul du pourcentage de similarité entre les visages détectés.</li>
|
| 277 |
+
<li>Possibilité d'utiliser la caméra de l'appareil pour capturer des images.</li>
|
| 278 |
+
<li>Interface utilisateur intuitive et facile à utiliser.</li>
|
| 279 |
+
</ul>
|
| 280 |
+
<h3 class="text-xl font-bold text-gray-800 mt-6 mb-2">Technologies utilisées :</h3>
|
| 281 |
+
<ul>
|
| 282 |
+
<li>
|
| 283 |
+
<strong>Backend :</strong> <a href="https://flask.palletsprojects.com/" target="_blank" class="text-blue-600 hover:underline">Flask</a> (framework web Python)
|
| 284 |
+
</li>
|
| 285 |
+
<li>
|
| 286 |
+
<strong>Reconnaissance faciale :</strong> <a href="https://github.com/serengil/deepface" target="_blank" class="text-blue-600 hover:underline">DeepFace</a> (librairie Python)
|
| 287 |
+
<ul class="tech-used">
|
| 288 |
+
<li>
|
| 289 |
+
Modèle par défaut : <strong>VGG-Face</strong>
|
| 290 |
+
</li>
|
| 291 |
+
<li>
|
| 292 |
+
Détecteur de visage par défaut : <strong>RetinaFace</strong>
|
| 293 |
+
</li>
|
| 294 |
+
<li>
|
| 295 |
+
Métrique de distance : <strong>Cosine</strong>
|
| 296 |
+
</li>
|
| 297 |
+
</ul>
|
| 298 |
+
</li>
|
| 299 |
+
<li>
|
| 300 |
+
<strong>Frontend :</strong> HTML, CSS (avec <a href="https://tailwindcss.com/" target="_blank" class="text-blue-600 hover:underline">Tailwind CSS</a> pour un style rapide), JavaScript
|
| 301 |
+
</li>
|
| 302 |
+
<li>
|
| 303 |
+
<strong>Icônes :</strong> <a href="https://fontawesome.com/" target="_blank" class="text-blue-600 hover:underline">Font Awesome</a>
|
| 304 |
+
</li>
|
| 305 |
+
<li>
|
| 306 |
+
<strong>Animations :</strong> <a href="https://animate.style/" target="_blank" class="text-blue-600 hover:underline">Animate.css</a>
|
| 307 |
+
</li>
|
| 308 |
+
</ul>
|
| 309 |
+
</div>
|
| 310 |
<div class="grid md:grid-cols-2 gap-8">
|
| 311 |
<!-- Section de capture -->
|
| 312 |
<div class="bg-white rounded-xl shadow-xl p-6 animate__animated animate__fadeInLeft">
|
|
|
|
| 380 |
|
| 381 |
<!-- Script JavaScript -->
|
| 382 |
<script>
|
| 383 |
+
let uploadedImages = [];
|
| 384 |
|
|
|
|
| 385 |
const fileInput = document.getElementById('fileInput');
|
| 386 |
fileInput.addEventListener('change', handleImageUpload);
|
| 387 |
|
|
|
|
| 403 |
}
|
| 404 |
}
|
| 405 |
|
|
|
|
| 406 |
document.querySelectorAll('.delete-btn').forEach(button => {
|
| 407 |
button.addEventListener('click', function() {
|
| 408 |
const targetPreviewId = this.dataset.target;
|
| 409 |
const targetPreview = document.getElementById(targetPreviewId);
|
| 410 |
targetPreview.style.backgroundImage = '';
|
| 411 |
|
|
|
|
| 412 |
uploadedImages = uploadedImages.filter(image => image.preview !== targetPreviewId);
|
| 413 |
|
| 414 |
updateCompareButtonState();
|
| 415 |
});
|
| 416 |
});
|
| 417 |
|
|
|
|
| 418 |
const cameraBtn = document.getElementById('cameraBtn');
|
| 419 |
const video = document.getElementById('video');
|
| 420 |
let stream = null;
|
|
|
|
| 439 |
}
|
| 440 |
});
|
| 441 |
|
|
|
|
| 442 |
video.addEventListener('click', () => {
|
| 443 |
if (stream && uploadedImages.length < 2) {
|
| 444 |
const canvas = document.createElement('canvas');
|
|
|
|
| 457 |
}
|
| 458 |
});
|
| 459 |
|
|
|
|
| 460 |
const compareBtn = document.getElementById('compareBtn');
|
| 461 |
compareBtn.addEventListener('click', () => {
|
| 462 |
if (uploadedImages.length === 2) {
|
|
|
|
| 487 |
compareBtn.classList.toggle('hidden', uploadedImages.length < 2);
|
| 488 |
}
|
| 489 |
|
|
|
|
| 490 |
function showResults(data) {
|
| 491 |
const resultsDiv = document.getElementById('results');
|
| 492 |
resultsDiv.classList.remove('show');
|
|
|
|
| 511 |
</div>
|
| 512 |
`;
|
| 513 |
resultsDiv.classList.add('show');
|
|
|
|
| 514 |
setTimeout(() => {
|
| 515 |
const progressBarFill = resultsDiv.querySelector('.progress-bar-fill');
|
| 516 |
progressBarFill.style.width = `${data.similarity}%`;
|
|
|
|
| 532 |
}, 300);
|
| 533 |
}
|
| 534 |
|
|
|
|
| 535 |
function showLoading() {
|
| 536 |
document.querySelector('.loading-overlay').style.display = 'flex';
|
| 537 |
}
|