실시간 얼굴 감지 기능을 갖춘 AR 프로필 카드 구축
소개
얼굴 움직임을 추적하고 실시간으로 반응하는 인터랙티브 3D 프로필 카드를 상상해보세요. 이것이 3D AR 프로필 카드의 핵심입니다. P-R이 만들었습니다. JavaScript, React 및 Firebase 전문 지식을 갖춘 수석 개발자인 Lopez는 최첨단 얼굴 인식 기술과 역동적인 글로우 효과, 풍부한 그라데이션 및 정교한 레이아웃을 특징으로 하는 세련된 프리미엄 디자인을 결합합니다. 개인적인 차원에서 사용자의 참여를 유도하는 데 적합합니다.
이 튜토리얼에서는 실시간 얼굴 감지를 위해 TensorFlow의 FaceMesh와 함께 HTML, CSS, JavaScript를 사용하여 대화형 프로필 카드를 구축하겠습니다. 이 구성 요소는 기억에 남는 대화형 경험이 필요한 전문 포트폴리오나 애플리케이션에 이상적입니다. 더욱 인터랙티브한 프로젝트에 관심이 있다면 고대 로마에서 영감을 받아 몰입감 넘치는 전략과 시각적으로 뛰어난 디자인이 결합된 스릴 넘치는 검투사 카드 게임인 Gladiators Battle을 놓치지 마세요.
이 프로필 카드를 만들어 보겠습니다!
1단계: HTML 구조 설정
프로필 카드에는 얼굴 인식을 위한 웹캠 피드, 사용자 정보, 소셜 미디어 아이콘이 포함됩니다.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3D AR Profile Card with Face Detection</title> <link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> </head> <body> <!-- Video for webcam stream --> <video> <p>Key HTML Elements<br> Webcam Video: Captures real-time video for face detection.<br> Profile Card: Contains profile information, including name, location, experience, skills, and links to Gladiators Battle and social media.<br> Social Icons: Link to GitHub, LinkedIn, and Twitter (or X), providing a fully interactive and connected profile.<br> Step 2: Styling the Profile Card with CSS<br> The CSS brings the 3D and AR effects to life, with gradients, glowing shadows, and animations for an eye-catching experience.</p> <p>Body and Background<br> The body uses a radial gradient to create a soft, dark background that complements the card’s glowing effects.<br> </p> <pre class="brush:php;toolbar:false">body { display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; background: radial-gradient(circle at center, #2d2d2d, #1b1b1b); overflow: hidden; font-family: 'Arial', sans-serif; } /* Webcam */ #webcam { position: fixed; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: -1; }
프로필 카드 디자인
프로필 카드 자체도 그라데이션 배경과 3D 변형, 그림자 효과를 활용해 돋보입니다.
.profile-card { position: relative; width: 370px; padding: 35px; border-radius: 25px; background: linear-gradient(145deg, #3d3d3d, #2a2a2a); box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.1); transform-style: preserve-3d; transform: perspective(1000px); transition: transform 0.3s ease, box-shadow 0.3s ease; z-index: 1; } .profile-card:hover { box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 50px rgba(255, 215, 0, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.2); transform: scale(1.03); }
아바타 및 텍스트 스타일링
아바타와 텍스트는 빛나고 대담한 효과와 함께 카드의 프리미엄 미학에 맞게 스타일이 지정되었습니다.
.profile-avatar { width: 130px; height: 130px; background: url('avatar.jpg') center/cover; border-radius: 50%; margin: 0 auto; box-shadow: 0px 0px 20px rgba(255, 255, 255, 0.4), 0px 0px 30px rgba(255, 215, 0, 0.5); transform: translateZ(70px); transition: box-shadow 0.3s ease, transform 0.3s ease; } .profile-name { font-size: 30px; text-align: center; color: #ffffff; margin-top: 20px; transform: translateZ(50px); background: linear-gradient(45deg, #ffd700, #ffa500, #ff4500); -webkit-background-clip: text; color: transparent; font-weight: bold; text-shadow: 0px 3px 5px rgba(0, 0, 0, 0.4); }
3단계: TensorFlow FaceMesh를 사용한 얼굴 감지
JavaScript 코드는 TensorFlow의 FaceMesh 모델을 사용하여 얼굴을 감지하고 프로필 이미지를 동적으로 설정합니다. 이러한 최첨단 접근 방식은 카드에 AR 느낌을 선사합니다.
웹캠 및 얼굴 인식 설정
setupCameraAndModel 함수는 웹캠 피드를 초기화하고 FaceMesh 모델을 로드하여 얼굴 추적을 시작합니다.
const video = document.getElementById('webcam'); const profileAvatar = document.querySelector('.profile-avatar'); async function setupCameraAndModel() { const model = await facemesh.load(); const stream = await navigator.mediaDevices.getUserMedia({ video: { width: 640, height: 480 } }); video.srcObject = stream; video.addEventListener('loadeddata', () => { detectFaceAndCapture(model, stream); }); }
얼굴 인식 및 아바타 업데이트
discoverFaceAndCapture 기능은 얼굴이 감지되면 사진을 캡처하여 프로필 아바타의 배경으로 설정합니다.
async function detectFaceAndCapture(model, stream) { const predictions = await model.estimateFaces(video); if (predictions.length > 0) { const canvas = document.createElement('canvas'); canvas.width = video.videoWidth; canvas.height = video.videoHeight; const context = canvas.getContext('2d'); context.drawImage(video, 0, 0, canvas.width, canvas.height); const imageDataUrl = canvas.toDataURL('image/png'); profileAvatar.style.backgroundImage = `url(${imageDataUrl})`; stream.getTracks().forEach(track => track.stop()); video.style.display = 'none'; } else { requestAnimationFrame(() => detectFaceAndCapture(model, stream)); } } // Initialize camera and model setupCameraAndModel();
AR 기술을 활용해 프로필 사진을 실시간으로 역동적으로 설정해 프로필 카드에 색다른 터치를 더하는 방식이다.
결론
실시간 얼굴 인식 기능을 갖춘 대화형 3D AR 프로필 카드를 만들면 개인 웹사이트나 전문 웹사이트에 현대적이고 고급스러운 느낌을 더할 수 있습니다. 이 튜토리얼에서는 TensorFlow를 사용하여 3D 효과를 위한 CSS와 동적 얼굴 감지를 위한 JavaScript를 결합하여 사용자 상호 작용을 향상시키는 강력한 접근 방식을 보여줍니다. 보다 혁신적이고 몰입도 높은 프로젝트에 관심이 있다면 역사적 주제와 전략적 게임플레이를 결합한 흥미진진한 검투사 카드 게임인 Gladiators Battle을 놓치지 마세요. GladiatorsBattle.com에서 자세한 내용을 알아보세요.
? 더 알아보기:
검투사 전투 탐색: https://gladiatorsbattle.com에서 고대 전사와 장대한 전투의 세계로 들어가 보세요.
GitHub: https://github.com/HanGPIErr에서 코드 예제와 프로젝트를 확인하세요.
LinkedIn: https://www.linkedin.com/in/pierre-romain-lopez/에서 업데이트를 팔로우하세요.
Twitter: https://x.com/GladiatorsBT에서 X를 통해 소통하세요.
이 기사는 시각적으로 놀라운 대화형 웹 요소를 구축하기 위한 관문입니다. 첨단 기술과 직관적인 고품질 디자인을 결합하는 방법을 계속해서 탐구하는 데 동참해 주세요.
위 내용은 실시간 얼굴 감지 기능을 갖춘 AR 프로필 카드 구축의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











다른 날, 나는 Corey Ginnivan의 웹 사이트에서 스크롤 할 때 카드 모음이 서로 쌓이는 것을 발견했습니다.

Google Fonts가 새로운 디자인 (트윗)을 출시 한 것을 볼 수 있습니다. 마지막 큰 재 설계와 비교할 때 이것은 훨씬 더 반복적 인 느낌이 듭니다. 차이를 간신히 말할 수 있습니다

프로젝트에 카운트 다운 타이머가 필요한 적이 있습니까? 그런 것은 플러그인에 도달하는 것이 당연하지만 실제로는 훨씬 더 많습니다.

플렉스 레이아웃의 보라색 슬래시 영역에 대한 질문 플렉스 레이아웃을 사용할 때 개발자 도구 (d ...)와 같은 혼란스러운 현상이 발생할 수 있습니다.

요소 수가 고정되지 않은 경우 CSS를 통해 지정된 클래스 이름의 첫 번째 자식 요소를 선택하는 방법. HTML 구조를 처리 할 때 종종 다른 요소를 만듭니다 ...

새로운 프로젝트가 시작될 때, Sass 컴파일은 눈을 깜박이게합니다. 특히 BrowserSync와 짝을 이루는 경우 기분이 좋습니다.

프론트 엔드 개발에서 Windows와 같은 구현 방법 ...
