-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (42 loc) · 1.88 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Handwritten Digit Recognition using Convolutional Neural Networks</title>
<link rel="stylesheet" href="{{ url_for('static',filename='style.css') }}">
</head>
<body>
<h1>Handwritten Digit Recognition using <span>Convolutional Neural Networks</span></h1>
<canvas id="canvas" width="280" height="280" style="border:8px solid; float: left; margin: 70px; margin-top:160px; border-radius: 5px; cursor: crosshair;"></canvas>
<div id="debug" style="margin:65px; margin-top:100px;">
<!-- <input type="color" id="colors">
<input type="number" id="lineWidth" style="width:60px" value="0.2" step="0.1" min="0.1"> -->
<input type="button" id="clearButton" value="Clear" style="">
<br/>
<span style="color: #4DAF7C; font-weight: 400; font-family: 'Open Sans', Helvetica; ">Draw the Digit inside this Box!</span>
</div>
<div style="margin-left:175px; margin-top:460px; float:left; position:absolute;">
<a href="#" class="myButton"><span style=" font-weight: 400; font-family: 'Open Sans', Helvetica; "> Predict </span></a>
</div>
<div >
<h1 id="result" style="margin-right:20px; margin-top:300px;float:left;"><span> </span></h1>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src="{{ url_for('static',filename='index.js') }}"></script>
<script type="text/javascript">
$(".myButton").click(function(){
var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
var canvasObj = document.getElementById("canvas");
var img = canvasObj.toDataURL();
$.ajax({
type: "POST",
url: $SCRIPT_ROOT + "/predict/",
data: img,
success: function(data){
$('#result').text(' Predicted Output: '+data);
}
});
});
</script>
</body>
</html>