-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·132 lines (123 loc) · 6.73 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, shrink-to-fit=no'>
<meta http-equiv='X-UA-Compatible' content='ie=edge'>
<meta name='description' content='Digit Recognizer Application'>
<meta name='author' content='Omar Abusheikh'>
<meta name='keywords' content='portfolio website machine learning deep learning data science neural networks datascience nlp ocr computer vision'>
<title>Integer Classifier Application</title>
<!-- <link href='./static/css/vendor/fontawesome-free/css/all.min.css' rel='stylesheet' type='text/css'> -->
<link href='./static/css/vendor/fontawesome-free/css/all.min.css' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css' integrity='sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T' crossorigin='anonymous'>
<link rel='stylesheet' href='./static/css/style.min.css'>
<!-- <link rel='stylesheet' href='{{ url_for('static',filename='style.css') }}'> -->
</head>
<body>
<div class='content'>
<!-- ––––––––––––––––––––––––––––––––––––– * NAVBAR * ––––––––––––––––––––– -->
<nav id='omarNav' class='navbar'>
<a href='https://github.com/Ohmarr/MNIST_CNN_Digit_Classifier'>
<img class='grow navbar-logo' src='https://ohmarr.github.io/src/assets/oa-logo-reverse.png' alt='Omar Abusheikh Logo'>
</a>
<a href='https://github.com/Ohmarr/MNIST_CNN_Digit_Classifier'>
<h2 class='navbar-brand grow'>Digit Predictor</h2>
</a>
</nav>
<!-- ––––––––––––––––––––––––––––––––––––– * introduction / instructions * ––––––––––––––––––––– -->
<section id='intro-section' class='page-section'>
<div class='container'>
<h1>Handwritten Digit Recognition using Convolutional Neural Networks</h1>
<h3>Adjust the line width by dragging the slider. Current width: </h3>
<div class='row'>
<span id='slider-value'></span>
<input id='slider-range' type='range' min='15' max='25' value='22'/>
</div>
</div>
</section>
<!-- ––––––––––––––––––––––––––––––––––––– * canvas / predict / clear * ––––––––––––––––––––– -->
<section id='canvas-section' class='page-section'>
<!-- <div class='container'>Please visit my github page for a walkthrough of this app</div> -->
<div id='canvas-container' class='container'>
<canvas id='canvas'></canvas>
<h3>Write a number in the Canvas</h3>
<div class='row'>
<button id='predict-button' class='btn grow' href='#' type='button'>Predict</button>
<button id='clear-button' class='btn grow' type='button' value='Clear'>Clear</button>
</div>
</div>
<!-- <div id='widthnote' class='container'>Note: To prevent gaps in your digits, please use a line width greater than 20</div> -->
</section>
<!-- ––––––––––––––––––––––––––––––––––––– * result * ––––––––––––––––––––– -->
<section id='result-section' class='page-section'>
<div class='container'>
<h2 id='result' class='container'>...</h2>
</div>
</section>
</div>
<!-- ––––––––––––––––––––––––––––––––––––– * FOOTER / COPYRIGHT SECTION * ––––––––––––––––––––––––––––––––––––– -->
<footer class='row'>
<!-- Footer About Text -->
<div class='col-lg-4 col-12 container grow'>
<h4 >Direct Contact</h4>
<a class='grow' href = 'mailto: [email protected]'>[email protected]</a><br>
<a class='grow' href='tel:+15129639461'>+1-512-963-9461</a>
</div>
<!-- Footer Social Icons -->
<div id="footer-links-section" class='col-lg-4 col-12 container grow'>
<h4 >Web</h4>
<a class='btn grow btn-social' href='https://www.linkedin.com/in/oabusheikh/' target= '_blank'><i class='grow fab fa-fw fa-linkedin'></i></a>
<a class='btn grow btn-social' href='https://github.com/Ohmarr' target= '_blank'><i class='grow fab fa-fw fa-github'></i></a>
<a class='btn grow btn-social' href='https://Ohmarr.github.io' target= '_blank'><i class='grow far fa-grin-alt'></i></a>
</div>
<!-- Footer Location -->
<div class='col-lg-4 col-12'>
<h4 >LOCATION</h4>
<p class='lead'>Austin, Texas 78741</p>
</div>
<div id="footer-copyright-section" class='container grow'>
<!-- Footer Location -->
<a id='copyright-text' href = 'http://Ohmarr.github.io'>
<small>Copyright © Ohmarr.github.io 2019</small>
</a>
</div>
</footer>
<!-- ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– -->
<script src='./static/js/jquery.min.js'></script>
<script src='./static/js/index.js'></script>
<!-- <script src='{{ url_for('static',filename='index.js') }}'></script> -->
<script type='text/javascript'>
$('#predict-button').click(function()
{
// var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
var canvasObj = document.getElementById('canvas');
var canvasData = canvasObj.toDataURL();
$.ajax(
{
type: 'POST',
url: '/predict/',
// url: $SCRIPT_ROOT + '/predict/',
data: canvasData,
success: function(data)
{
$('#result').text('The Model Predicts a '+data[1]);
// console.log(typeof(data))
// console.log($SCRIPT_ROOT)
console.log(canvasData)
}
}
);
});
$('#clear-button').click(function()
{
$.ajax($('#result').text('...'))
console.log('cleared')
});
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js' integrity='sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1' crossorigin='anonymous'></script>
<!-- <script src='https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js' integrity='sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM' crossorigin='anonymous'></script> -->
</body>
</html>