-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathself-training-model.html
43 lines (40 loc) · 1.73 KB
/
self-training-model.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/aframe-event-set-component.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/fern-ar@latest/dist/fernar-gesture.prod.js"></script> -->
<script src="../dist/fernar-gesture.prod.js"></script>
</head>
<body>
<script>
async function initializeScene() {
const jsonModelPath = "../model/model.json";
const binModelPath = "../model/model.weights.bin";
// const jsonModelPath = "../old-model/model.json";
// const binModelPath = "../old-model/model.weights.bin";
// Fetching JSON model file
const jsonResponse = await fetch(jsonModelPath);
const jsonModelFile = await jsonResponse.text();
// Fetching binary model file
const binResponse = await fetch(binModelPath);
const binModelFile = new Uint8Array(await binResponse.arrayBuffer());
await FERNAR.updateModel(jsonModelFile, binModelFile, binModelPath);
FERNAR.setDebugMode(true);
}
initializeScene();
</script>
<a-scene fernar-gesture>
<a-camera active="false" position="0 0 0"></a-camera>
<a-box
fernar-gesture-target="gesture: 0,1,2"
event-set__turnred="_event: fernar-gesture-event-0; material.color: red"
event-set__turnblue="_event: fernar-gesture-event-1; material.color: blue"
event-set__turngreen="_event: fernar-gesture-event-2; material.color: green"
color="yellow"
position="0 0 -10"
rotation="0 -30 0"
></a-box>
</a-scene>
</body>
</html>