-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (26 loc) · 799 Bytes
/
index.html
File metadata and controls
32 lines (26 loc) · 799 Bytes
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
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js"></script>
</head>
<body>
<input type="number" id="userInput" step="0.00000001">
<input type="button" value="Predict" onclick=" predict()">
<br>
<input type="text" id="output" disabled>
<script type="text/javascript">
async function predict() {
input = tf.tensor([
[
[parseInt(document.getElementById('userInput').value)]
]
]);
model = await tf.loadLayersModel(
'https://raw.githubusercontent.com/TheDevByte/mudkip/master/TestModel_js/model.json');
prediction = model.predict(input);
x = await prediction.data();
console.log(x);
document.getElementById("output").value = x;
}
</script>
</body>
</html>