Add 3 files
Browse filesFiles changed (3)
- README.md+6-4
- index.html+553-19
- prompts.txtAdded
12345678910---title: Facecheckemoji: 🏢colorFrom: bluecolorTo: purplesdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference123456789101112---title: facecheckemoji: 🐳colorFrom: bluecolorTo: bluesdk: staticpinned: falsetags:- deepsite---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>FaceMatch - AI Facial Recognition Search</title><script src="https://cdn.tailwindcss.com"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><script src="https://cdn.jsdelivr.net/npm/face-api.js@0.22.2/dist/face-api.min.js"></script><style>.dropzone {border: 2px dashed #3b82f6;border-radius: 0.5rem;transition: all 0.3s ease;}.dropzone.active {border-color: #10b981;background-color: rgba(16, 185, 129, 0.05);}.result-card {transition: all 0.3s ease;}.result-card:hover {transform: translateY(-5px);box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);}.loading-spinner {animation: spin 1s linear infinite;}@keyframes spin {0% { transform: rotate(0deg); }100% { transform: rotate(360deg); }}.face-box {position: absolute;border: 2px solid #3b82f6;background-color: rgba(59, 130, 246, 0.2);}</style></head><body class="bg-gray-50 min-h-screen"><header class="bg-white shadow-sm"><div class="container mx-auto px-4 py-4 flex justify-between items-center"><div class="flex items-center space-x-2"><i class="fas fa-user-circle text-blue-500 text-3xl"></i><h1 class="text-2xl font-bold text-gray-800">FaceMatch</h1></div><nav class="hidden md:flex space-x-6"><a href="#" class="text-gray-600 hover:text-blue-500">Home</a><a href="#" class="text-gray-600 hover:text-blue-500">How it works</a><a href="#" class="text-gray-600 hover:text-blue-500">API</a><a href="#" class="text-gray-600 hover:text-blue-500">Pricing</a><a href="#" class="text-gray-600 hover:text-blue-500">Blog</a></nav><div class="flex items-center space-x-4"><button class="px-4 py-2 text-gray-600 hover:text-blue-500"><i class="fas fa-user"></i></button><button class="md:hidden text-gray-600"><i class="fas fa-bars"></i></button></div></div></header><main class="container mx-auto px-4 py-8"><section class="text-center mb-12"><h2 class="text-4xl font-bold text-gray-800 mb-4">AI Facial Recognition Search</h2><p class="text-xl text-gray-600 max-w-3xl mx-auto">Upload a photo to find similar faces across the internet. Our powerful AI scans millions of images to find matches.</p></section><section class="max-w-4xl mx-auto mb-12"><div class="bg-white rounded-xl shadow-md p-6"><div class="flex flex-col md:flex-row gap-6"><div class="flex-1"><div id="dropzone" class="dropzone p-8 text-center cursor-pointer"><div class="flex flex-col items-center justify-center h-full"><i class="fas fa-cloud-upload-alt text-blue-500 text-5xl mb-4"></i><h3 class="text-xl font-semibold text-gray-700 mb-2">Drag & Drop your photo here</h3><p class="text-gray-500 mb-4">or click to browse files</p><input type="file" id="fileInput" class="hidden" accept="image/*"><button id="uploadBtn" class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded-lg transition">Select Image</button><p class="text-xs text-gray-400 mt-4">Supports JPG, PNG, WEBP (Max 5MB)</p></div></div></div><div class="flex-1"><div class="border border-gray-200 rounded-lg p-4 h-full"><h3 class="text-lg font-semibold text-gray-700 mb-4">Search Options</h3><div class="space-y-4"><div><label class="block text-gray-600 mb-2">Search Scope</label><select class="w-full p-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"><option>Entire Internet</option><option>Social Media Only</option><option>News Websites</option><option>Public Figures</option></select></div><div><label class="block text-gray-600 mb-2">Match Sensitivity</label><input type="range" min="50" max="100" value="80" class="w-full"><div class="flex justify-between text-xs text-gray-500"><span>Loose</span><span>Balanced</span><span>Strict</span></div></div><div class="flex items-center"><input type="checkbox" id="nsfwFilter" class="mr-2"><label for="nsfwFilter" class="text-gray-600">Filter NSFW content</label></div><button id="searchBtn" class="w-full bg-blue-500 hover:bg-blue-600 text-white py-3 rounded-lg font-medium transition opacity-50 cursor-not-allowed" disabled>Start Search</button></div></div></div></div></div></section><section id="previewSection" class="hidden max-w-4xl mx-auto mb-12"><div class="bg-white rounded-xl shadow-md p-6"><h3 class="text-xl font-semibold text-gray-700 mb-4">Image Preview</h3><div class="flex flex-col md:flex-row gap-6"><div class="flex-1 relative"><img id="previewImage" src="" alt="Preview" class="w-full rounded-lg"><div id="faceBoxes"></div></div><div class="flex-1"><div class="bg-gray-50 p-4 rounded-lg"><h4 class="font-medium text-gray-700 mb-2">Detected Faces</h4><div id="faceList" class="space-y-3"><!-- Faces will be added here dynamically --></div><div class="mt-4"><button id="analyzeBtn" class="w-full bg-blue-500 hover:bg-blue-600 text-white py-3 rounded-lg font-medium transition">Analyze Selected Faces</button></div></div></div></div></div></section><section id="loadingSection" class="hidden max-w-4xl mx-auto mb-12 text-center py-12"><div class="bg-white rounded-xl shadow-md p-8"><div class="inline-block loading-spinner text-blue-500 text-5xl mb-6"><i class="fas fa-spinner"></i></div><h3 class="text-2xl font-semibold text-gray-700 mb-2">Searching the web for matches</h3><p class="text-gray-500 mb-6">This may take a few moments...</p><div class="w-full bg-gray-200 rounded-full h-2.5"><div id="progressBar" class="bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div></div><p id="progressText" class="text-sm text-gray-500 mt-2">Initializing search...</p></div></section><section id="resultsSection" class="hidden max-w-6xl mx-auto mb-12"><div class="bg-white rounded-xl shadow-md p-6"><div class="flex justify-between items-center mb-6"><h3 class="text-xl font-semibold text-gray-700">Search Results</h3><div class="flex items-center space-x-2"><span class="text-gray-500">Sort by:</span><select class="p-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"><option>Best Match</option><option>Most Recent</option><option>Source Website</option></select></div></div><div id="resultsContainer" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"><!-- Results will be added here dynamically --></div><div class="mt-8 text-center"><button class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-lg font-medium transition">Load More Results</button></div></div></section><section class="max-w-4xl mx-auto mb-12 bg-blue-50 rounded-xl p-8"><h3 class="text-2xl font-semibold text-gray-700 mb-4 text-center">How FaceMatch Works</h3><div class="grid md:grid-cols-3 gap-6"><div class="text-center p-4"><div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4"><i class="fas fa-upload text-blue-500 text-2xl"></i></div><h4 class="font-medium text-gray-700 mb-2">Upload Image</h4><p class="text-gray-600">Upload a clear photo containing the face you want to search for.</p></div><div class="text-center p-4"><div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4"><i class="fas fa-brain text-blue-500 text-2xl"></i></div><h4 class="font-medium text-gray-700 mb-2">AI Analysis</h4><p class="text-gray-600">Our AI extracts facial features and creates a unique fingerprint.</p></div><div class="text-center p-4"><div class="bg-blue-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4"><i class="fas fa-search text-blue-500 text-2xl"></i></div><h4 class="font-medium text-gray-700 mb-2">Get Results</h4><p class="text-gray-600">Find matching faces across millions of images from public sources.</p></div></div></section></main><footer class="bg-gray-800 text-white py-12"><div class="container mx-auto px-4"><div class="grid grid-cols-1 md:grid-cols-4 gap-8"><div><h4 class="text-xl font-semibold mb-4">FaceMatch</h4><p class="text-gray-400">Advanced facial recognition technology to help you find people across the internet.</p></div><div><h4 class="text-lg font-semibold mb-4">Company</h4><ul class="space-y-2"><li><a href="#" class="text-gray-400 hover:text-white">About Us</a></li><li><a href="#" class="text-gray-400 hover:text-white">Careers</a></li><li><a href="#" class="text-gray-400 hover:text-white">Press</a></li><li><a href="#" class="text-gray-400 hover:text-white">Contact</a></li></ul></div><div><h4 class="text-lg font-semibold mb-4">Legal</h4><ul class="space-y-2"><li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li><li><a href="#" class="text-gray-400 hover:text-white">Terms of Service</a></li><li><a href="#" class="text-gray-400 hover:text-white">Data Processing</a></li><li><a href="#" class="text-gray-400 hover:text-white">Cookie Policy</a></li></ul></div><div><h4 class="text-lg font-semibold mb-4">Connect</h4><div class="flex space-x-4"><a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-twitter"></i></a><a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-facebook"></i></a><a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-instagram"></i></a><a href="#" class="text-gray-400 hover:text-white text-xl"><i class="fab fa-linkedin"></i></a></div><div class="mt-4"><p class="text-gray-400">Subscribe to our newsletter</p><div class="flex mt-2"><input type="email" placeholder="Your email" class="px-3 py-2 text-gray-800 rounded-l"><button class="bg-blue-500 hover:bg-blue-600 px-4 py-2 rounded-r"><i class="fas fa-paper-plane"></i></button></div></div></div></div><div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400"><p>© 2023 FaceMatch. All rights reserved.</p></div></div></footer><script>// Load face-api.js modelsasync function loadModels() {await faceapi.nets.tinyFaceDetector.loadFromUri('https://justadudewhohacks.github.io/face-api.js/models');await faceapi.nets.faceLandmark68Net.loadFromUri('https://justadudewhohacks.github.io/face-api.js/models');await faceapi.nets.faceRecognitionNet.loadFromUri('https://justadudewhohacks.github.io/face-api.js/models');console.log('Models loaded');}// Call loadModels when the page loadsdocument.addEventListener('DOMContentLoaded', loadModels);// DOM elementsconst dropzone = document.getElementById('dropzone');const fileInput = document.getElementById('fileInput');const uploadBtn = document.getElementById('uploadBtn');const searchBtn = document.getElementById('searchBtn');const previewSection = document.getElementById('previewSection');const previewImage = document.getElementById('previewImage');const faceBoxes = document.getElementById('faceBoxes');const faceList = document.getElementById('faceList');const analyzeBtn = document.getElementById('analyzeBtn');const loadingSection = document.getElementById('loadingSection');const resultsSection = document.getElementById('resultsSection');const resultsContainer = document.getElementById('resultsContainer');const progressBar = document.getElementById('progressBar');const progressText = document.getElementById('progressText');// Event listenersuploadBtn.addEventListener('click', () => fileInput.click());fileInput.addEventListener('change', handleFileSelect);dropzone.addEventListener('dragover', (e) => {e.preventDefault();dropzone.classList.add('active');});dropzone.addEventListener('dragleave', () => {dropzone.classList.remove('active');});dropzone.addEventListener('drop', (e) => {e.preventDefault();dropzone.classList.remove('active');if (e.dataTransfer.files.length) {fileInput.files = e.dataTransfer.files;handleFileSelect({ target: fileInput });}});analyzeBtn.addEventListener('click', startSearch);// Handle file selectionasync function handleFileSelect(event) {const file = event.target.files[0];if (!file) return;if (!file.type.match('image.*')) {alert('Please select an image file (JPG, PNG, WEBP)');return;}if (file.size > 5 * 1024 * 1024) {alert('File size exceeds 5MB limit');return;}// Display previewconst reader = new FileReader();reader.onload = async (e) => {previewImage.src = e.target.result;previewSection.classList.remove('hidden');// Detect facesawait detectFaces(previewImage);// Enable search buttonsearchBtn.disabled = false;searchBtn.classList.remove('opacity-50', 'cursor-not-allowed');};reader.readAsDataURL(file);}// Detect faces in imageasync function detectFaces(image) {faceBoxes.innerHTML = '';faceList.innerHTML = '';const detections = await faceapi.detectAllFaces(image, new faceapi.TinyFaceDetectorOptions()).withFaceLandmarks().withFaceDescriptors();if (detections.length === 0) {faceList.innerHTML = '<p class="text-gray-500">No faces detected</p>';return;}// Display face boxesconst displaySize = { width: image.width, height: image.height };const resizedDetections = faceapi.resizeResults(detections, displaySize);resizedDetections.forEach((detection, i) => {const box = detection.detection.box;const faceBox = document.createElement('div');faceBox.className = 'face-box';faceBox.style.left = `${box.x}px`;faceBox.style.top = `${box.y}px`;faceBox.style.width = `${box.width}px`;faceBox.style.height = `${box.height}px`;faceBox.dataset.index = i;faceBoxes.appendChild(faceBox);// Add face to listconst faceItem = document.createElement('div');faceItem.className = 'flex items-center p-2 bg-white rounded-md cursor-pointer hover:bg-blue-50';faceItem.dataset.index = i;const faceThumb = document.createElement('div');faceThumb.className = 'relative w-12 h-12 mr-3';const faceImg = document.createElement('img');faceImg.src = previewImage.src;faceImg.className = 'w-full h-full object-cover rounded';faceThumb.appendChild(faceImg);const faceBoxThumb = document.createElement('div');faceBoxThumb.className = 'absolute border-2 border-blue-500';faceBoxThumb.style.left = `${-box.x / (image.naturalWidth / image.width)}px`;faceBoxThumb.style.top = `${-box.y / (image.naturalHeight / image.height)}px`;faceBoxThumb.style.width = `${box.width / (image.naturalWidth / image.width)}px`;faceBoxThumb.style.height = `${box.height / (image.naturalHeight / image.height)}px`;faceThumb.appendChild(faceBoxThumb);const faceLabel = document.createElement('div');faceLabel.innerHTML = `<span class="block font-medium">Face ${i + 1}</span><span class="text-xs text-gray-500">${Math.round(detection.detection.score * 100)}% confidence</span>`;faceItem.appendChild(faceThumb);faceItem.appendChild(faceLabel);faceList.appendChild(faceItem);// Highlight face when hovering over list itemfaceItem.addEventListener('mouseenter', () => {faceBox.style.borderColor = '#10b981';faceBox.style.backgroundColor = 'rgba(16, 185, 129, 0.3)';});faceItem.addEventListener('mouseleave', () => {faceBox.style.borderColor = '#3b82f6';faceBox.style.backgroundColor = 'rgba(59, 130, 246, 0.2)';});// Select face when clickedfaceItem.addEventListener('click', () => {document.querySelectorAll('#faceList div').forEach(item => {item.classList.remove('bg-blue-100', 'border-blue-500');});faceItem.classList.add('bg-blue-100', 'border-blue-500');});});// Select first face by defaultif (faceList.firstChild) {faceList.firstChild.click();}}// Start searchfunction startSearch() {previewSection.classList.add('hidden');loadingSection.classList.remove('hidden');// Simulate progresslet progress = 0;const interval = setInterval(() => {progress += Math.random() * 10;if (progress > 100) progress = 100;progressBar.style.width = `${progress}%`;if (progress < 30) {progressText.textContent = 'Indexing facial features...';} else if (progress < 60) {progressText.textContent = 'Searching public databases...';} else if (progress < 90) {progressText.textContent = 'Analyzing potential matches...';} else {progressText.textContent = 'Finalizing results...';}if (progress === 100) {clearInterval(interval);setTimeout(showResults, 1000);}}, 500);}// Show resultsfunction showResults() {loadingSection.classList.add('hidden');resultsSection.classList.remove('hidden');// Generate mock resultsconst mockResults = [{url: 'https://example.com/profile1',image: 'https://randomuser.me/api/portraits/women/44.jpg',title: 'Social Media Profile',similarity: '92%',source: 'Facebook',date: '2023-05-15'},{url: 'https://example.com/news1',image: 'https://randomuser.me/api/portraits/women/68.jpg',title: 'News Article Mention',similarity: '87%',source: 'CNN',date: '2023-03-22'},{url: 'https://example.com/forum1',image: 'https://randomuser.me/api/portraits/men/32.jpg',title: 'Forum Discussion',similarity: '84%',source: 'Reddit',date: '2022-11-05'},{url: 'https://example.com/profile2',image: 'https://randomuser.me/api/portraits/men/75.jpg',title: 'Professional Profile',similarity: '79%',source: 'LinkedIn',date: '2023-01-18'},{url: 'https://example.com/blog1',image: 'https://randomuser.me/api/portraits/women/12.jpg',title: 'Blog Post',similarity: '76%',source: 'Medium',date: '2022-09-30'},{url: 'https://example.com/event1',image: 'https://randomuser.me/api/portraits/men/90.jpg',title: 'Event Photo',similarity: '72%',source: 'Meetup',date: '2022-07-14'}];// Display resultsresultsContainer.innerHTML = '';mockResults.forEach(result => {const resultCard = document.createElement('div');resultCard.className = 'result-card bg-white rounded-lg overflow-hidden shadow-md hover:shadow-lg';resultCard.innerHTML = `<a href="${result.url}" target="_blank" class="block"><div class="relative h-48 overflow-hidden"><img src="${result.image}" alt="Result" class="w-full h-full object-cover"><div class="absolute bottom-2 right-2 bg-blue-500 text-white text-xs font-bold px-2 py-1 rounded">${result.similarity} match</div></div><div class="p-4"><h4 class="font-semibold text-gray-800 mb-1">${result.title}</h4><div class="flex justify-between text-sm text-gray-500"><span>${result.source}</span><span>${result.date}</span></div></div></a>`;resultsContainer.appendChild(resultCard);});}</script><p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=bozz723/facecheck" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body></html>
README.md+6-4
index.html+553-19
prompts.txtAdded