Commit 6affa88 1 parent e33de6f commit 6affa88 Copy full SHA for 6affa88
File tree 4 files changed +17
-17
lines changed
4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 1
1
< html >
2
2
< head >
3
- < script src ="../../dist-dev/mindar-face.js " type ="module "> </ script >
4
3
< script >
5
4
const loadImage = async ( src ) => {
6
5
return new Promise ( ( resolve , reject ) => {
12
11
</ script >
13
12
14
13
< script type ="module ">
14
+ import { Controller } from "../../dist-dev/mindar-face.js" ;
15
+
15
16
const process = async ( ) => {
16
17
const queryImage = await loadImage ( './assets/face1.jpeg' ) ;
17
18
18
- const controller = new window . MINDAR . FACE . Controller ( { } ) ;
19
- await controller . setup ( ) ;
20
- controller . setInputSize ( queryImage . width , queryImage . height ) ;
21
- controller . setDisplaySize ( queryImage . width , queryImage . height ) ;
22
-
23
- const hasFace = await controller . detect ( queryImage ) ;
24
- console . log ( "detected face" , hasFace , controller . faceGeometry ) ;
19
+ const controller = new Controller ( { } ) ;
20
+ await controller . setup ( queryImage ) ;
25
21
26
- const landmark = controller . getLandmarkProperties ( 0 ) ;
27
- console . log ( "landmark " , landmark ) ;
22
+ const result = await controller . faceMeshHelper . detect ( queryImage ) ;
23
+ console . log ( "result " , result ) ;
28
24
}
29
25
process ( ) ;
30
26
</ script >
Original file line number Diff line number Diff line change 3
3
< script src ="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.7.2/min/dropzone.min.js "> </ script >
4
4
< link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.7.2/dropzone.min.css ">
5
5
<!-- <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script> -->
6
+ <!--
6
7
<script id="mindar-module" src="../../dist-dev/mindar-image.js" type="module"></script>
8
+ -->
7
9
8
10
< script type ="module ">
11
+ import { Compiler } from "../../dist-dev/mindar-image.js" ;
12
+
9
13
Dropzone . autoDiscover = false ;
10
- document . getElementById ( 'mindar-module' ) . onload = ( ) => {
14
+ // document.getElementById('mindar-module').onload=()=>{
11
15
const compiler = new window . MINDAR . IMAGE . Compiler ( ) ;
12
16
13
17
const download = ( buffer ) => {
134
138
}
135
139
} ) ;
136
140
} ) ;
137
- } ;
141
+ // };
138
142
</ script >
139
143
140
144
< style >
Original file line number Diff line number Diff line change 1
1
< html >
2
2
< head >
3
- < script src ="../../dist-dev/mindar-image.js "> </ script >
4
3
< script >
5
4
const loadImage = async ( src ) => {
6
5
return new Promise ( ( resolve , reject ) => {
11
10
} ;
12
11
</ script >
13
12
14
- < script >
13
+ < script type ="module ">
14
+ import { Controller } from "../../dist-dev/mindar-image.js" ;
15
+
15
16
const process = async ( ) => {
16
17
const queryImage = await loadImage ( './assets/card-example/test-card.png' ) ;
17
18
18
- const controller = new MINDAR . IMAGE . Controller ( { inputWidth : queryImage . width , inputHeight : queryImage . height } ) ;
19
+ const controller = new window . MINDAR . IMAGE . Controller ( { inputWidth : queryImage . width , inputHeight : queryImage . height } ) ;
19
20
const { dimensions, matchingDataList, imageListList} = await controller . addImageTargets ( './assets/card-example/card.mind' ) ;
20
21
21
22
const { featurePoints} = await controller . detect ( queryImage ) ;
Original file line number Diff line number Diff line change @@ -21,10 +21,9 @@ <h2>Face-Tracking</h2>
21
21
< li > < a href ="examples/face-tracking/example1.html "> Example 1</ a > </ li >
22
22
< li > < a href ="examples/face-tracking/example2.html "> Example 2</ a > </ li >
23
23
< li > < a href ="examples/face-tracking/example3.html "> Example 3</ a > </ li >
24
- < li > < a href ="examples/face-tracking/example4.html "> Example 4</ a > </ li >
25
24
< li > < a href ="examples/face-tracking/three-css.html "> three-CSS</ a > </ li >
26
25
< li > < a href ="examples/face-tracking/three-facemesh.html "> three-FaceMesh</ a > </ li >
27
26
< li > < a href ="examples/face-tracking/three.html "> three</ a > </ li >
28
27
</ ul >
29
28
</ body >
30
- </ html >
29
+ </ html >
You can’t perform that action at this time.
0 commit comments