-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
index.html
77 lines (67 loc) · 2.76 KB
/
index.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!--
Copyright 2018 Google LLC. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================
-->
<!doctype html>
<head>
<link rel="stylesheet" href="../shared/tfjs-examples.css" />
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<div class="tfjs-example-container centered-container">
<section class='title-area'>
<h1>TensorFlow.js: Simple Object Detection</h1>
<p class='subtitle'>Train a model to classify and localize triangles and rectangles</p>
</section>
<p class='section-head'>Description</p>
<p>
This example page shows inference with a pretrained object-detection model
that can classify and localize (i.e., give the position of) target shapes
in simple synthesized scenes. The training happens in tfjs-node (see
<a href="https://github.com/tensorflow/tfjs-examples/blob/master/simple-object-detection/train.js">
train.js
</a>
in the source folder).
</p>
<p>
The target objects that we want to detect are triangles and rectangles,
in the background are line segments and circles that the model should ignore.
Each synthetic scene contains only one target object.
Each inference by the model generates the bounding box of the target
object (show as the blue box), which can be compared with the true
bounding box (show as the red box). In addition, the inference output
contains the class of the shape (triangle vs. rectangle).
</p>
</p>
<div id="status">Loading model...</div>
<button id="load-hosted-model" disabled="true">Load Hosted model</button>
<button id="test" disabled="true">Test model</button>
<div>
<canvas id="data-canvas" width="224" height="224"></canvas>
</div>
<div>
<div>
<span>Inference time (ms):</span>
<span id="inference-time-ms"></span>
</div>
<div>
<span>True object class:</span>
<span class="shape-class" id="true-object-class"></span>
</div>
<div>
<span>Predicted object class:</span>
<span class="shape-class" id="predicted-object-class"></span>
</div>
</div>
</div>
</body>
<script type="module" src="index.js"></script>