<html>
<head>
<title>面网识别--京剧脸</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script async src="./libs/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "./libs/three.module.js",
"three/addons/": "https://unpkg.com/three@0.136.0/examples/jsm/",
"mindar-face-three":"./libs/mindar-face-three.prod.js"
}
}
</script>
<script type="module">
import * as THREE from 'three';
import {MindARThree} from 'mindar-face-three';
const mindarThree = new MindARThree({
container: document.querySelector("#container"),
});
const { renderer, scene, camera } = mindarThree;
const light = new THREE.HemisphereLight(0xffffff, 0xbbbbff, 1);
scene.add(light);
const faceMesh = mindarThree.addFaceMesh();
const texture = new THREE.TextureLoader().load('./assets/京剧面具.png');
faceMesh.material.map = texture;
faceMesh.material.transparent = true;
faceMesh.material.needsUpdate = true;
scene.add(faceMesh);
const start = async () => {
await mindarThree.start();
renderer.setAnimationLoop(() => {
renderer.render(scene, camera);
});
}
start();
</script>
<style>
body {
margin: 0;
}
#container {
width: 100vw;
height: 100vh;
position: relative;
overflow: hidden;
}
</style>
</head>
<body>
<div id="container">
</div>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
基于Three.js和MindAR实现的网页端WebAR人脸识别追踪功能的京剧换脸Demo源码(可独立部署)
共15个文件
js:10个
wasm:1个
binarypb:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 12 下载量 15 浏览量
2023-03-10
14:24:41
上传
评论 2
收藏 8.71MB 7Z 举报
温馨提示
建议先看效果和说明:https://blog.csdn.net/qq_33789001/article/details/129442180 该功能基于mind-ar-js-master\examples\face-tracking\example1.html案例修改而来,主要是将部分托管在cdn服务器的脚本库进行了本地化关联(解决加载太慢的问题)和替换了面部网格贴图。 近段时间一直在玩MindAR的功能,之前一直在弄图片识别追踪的功能,发现其强大的功能还有脸部识别和追踪的功能,就基于其面部网格的例子修改了一个国粹京剧的换脸程序。基于MindAR实现的网页端WebAR图片识别叠加动作模型追踪功能,其中包含了大致的配置步骤和图片识别的功能。本文就以仓库中的面网案例的基础上进行了修改,将部分托管在cdn服务器的脚本库进行了本地化关联(解决加载太慢的问题),利用了笔者的超低PS技术进行了京剧面网的p图,实现了该效果。按MindAR作者的说法是可以在手机上运行,但是笔者在进行手机测试的时候,一直在转圈加载中,并未在手机上成功使用该功能,如果有大佬知道是啥问题也请指点一下。
资源推荐
资源详情
资源评论
收起资源包目录
WebARFaceDemo.7z (15个子文件)
WebARFaceDemo
assets
京剧面具.png 3.17MB
facemeshdata
face_mesh_solution_simd_wasm_bin.js 242KB
face_mesh.binarypb 939B
face_mesh_solution_packed_assets_loader.js 9KB
face_mesh_solution_packed_assets.data 3.8MB
face_mesh_solution_simd_wasm_bin.wasm 5.91MB
facemesh-jingjumask.html 1KB
libs
controller.008258e8.js 2.06MB
three.module.js 1.12MB
aframe.min.js 1.89MB
ui.4498bf0c.js 5KB
mindar-face-three.prod.js 6KB
CSS3DRenderer.js 7KB
es-module-shims.js 47KB
mindar-face-aframe.prod.js 1.99MB
共 15 条
- 1
十幺卜入
- 粉丝: 7968
- 资源: 51
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页