-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (33 loc) · 1.48 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
<!DOCTYPE html>
<html>
<head>
<title>Image classifier</title>
<link rel="stylesheet" type="text/css" href="style.css">
<!-- load ml5 library
ml5 is a library built on top of TensorFlow.js with no other external dependencies.
it provides access to machine learning algorithms and models in the browser
-->
<script src="https://unpkg.com/[email protected]/dist/ml5.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<h2 id="main-title">A simple image classifier using <a href="https://ml5js.org" target="blank">ml5</a> and <a href="https://www.tensorflow.org"
target="blank">TensorFlow</a></h2>
<div id="app-ctn">
<div id="upload-ctn">
<input type="file" accept=".jpg, .jpeg, .png" id="image-uploader-input" onchange="handleFileSelect()" style="cursor:pointer">
</div>
<div id="display-ctn">
<div id="image-ctn">
<img src="" crossorigin="anonymous" id="loaded-image" onerror="this.style.display='none'">
</div>
<p><span class="label">Classification : </span><span id="classification-result"></span></p>
<p><span class="label">Probability : </span><span id="classification-prob"></span></p>
</div>
<div id="controls-ctn">
<button class="tensor-btn cancel-btn" onclick="reset()">Reset</button>
<button class="tensor-btn validation-btn" onclick="classify()">Classify !</button>
</div>
</div>
</body>
</html>