-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
233 lines (136 loc) · 5.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ICH Analyzer</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Use the power of Machine Learning to automatically detect intracranial hemorrhages on brain ct images.">
<!--Code to prevent the browser from caching the page-->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<!--CSS Stylesheets-->
<link rel="stylesheet" href="css/w3.css">
<link rel="stylesheet" href="css/brain.css">
<!--Link to Font Awesome icons-->
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.4.2/css/all.css' integrity='sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns' crossorigin='anonymous'>
<!--Link to fonts from google fonts-->
<link href="https://fonts.googleapis.com/css?family=Oswald:300" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="robotfavicon.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html,body,h2,h3,h4 {font-family: Helvetica, sans-serif}
</style>
<style>
.origImage {
position: absolute;
top: 0px; /* Refers to the div tag. */
left: 0px; /* Refers to the div tag. */
z-index: 99;
}
.colorImage {
position: absolute;
top: 0px; /* Refers to the div tag. */
left: 0px; /* Refers to the div tag. */
z-index: 100;
opacity: 0.85;
}
.segImage {
position: absolute;
top: 0px; /* Refers to the div tag. */
left: 0px; /* Refers to the div tag. */
z-index: 101;
}
/* We wrap the absolute camnvas inside a relative div element
so that the canvas acts responsively, because the div is response.
This div is positioned relative so it will act as an anchor for the
canvas elements which are positioned absolute.*/
.mycontainer {
position: relative;
/*background: red; Uncomment this to see the div container.*/
height: 280px;
width: 330px;
}
</style>
</head>
<body class="w3-pale-blue">
<!-- w3-content defines a container for fixed size centered content,
and is wrapped around the whole page content. -->
<div class="w3-content card" style="max-width:960px">
<!-- 1. HOME PAGE TAB -->
<div class="tabbed w3-animate-opacity w3-white" id="home">
<!-- Header -->
<div class="w3-center title adjust-fontcolor logo">
<h1 class="space-letters w3-text-purple"></i><b>Intracranial Hemorrhage<br> Analyzer</b></h1>
<h5 class="space-letters tag-font w3-text-red"><b>powered by<br> Artificial Intelligence</b></h5>
</div>
<!-- Front page image -->
<!-- This image will be replaced once the js code runs. -->
<div class="w3-center">
<!-- HIDDEN TAG. This is the img tag that the model reads from. For best results
it does not reduce the input image size in any way. -->
<div class="hide">
<img id="selected-image" class="w3-round" src="assets/ich.jpg" alt="">
<img id="color-image" class="w3-round" src="assets/color_200.png" alt="">
</div>
<i class="spinner fa fa-refresh fa-spin" style="font-size:24px"></i>
<div>
<div class='unblock'>
<!-- This is the resized image that is displayed on the page. -->
<img id="displayed-image" class="w3-round" src="assets/ich.jpg" width="250" height="250"alt="">
</div>
<!-- This is the canvas where the model prediction is displayed. -->
<div class='mycontainer unblock'>
<canvas id="myCanvas2" class="segImage w3-round w3-margin w3-border" width="250" height="250"
style="">
Sorry. Your browser does not support the HTML5 canvas tag.</canvas>
<canvas id="myCanvas3" class="origImage w3-round w3-margin w3-border" width="250" height="250"
style="">
Sorry. Your browser does not support the HTML5 canvas tag.</canvas>
<canvas id="myCanvas4" class="colorImage w3-round w3-margin w3-border" width="250" height="250"
style="">
Sorry. Your browser does not support the HTML5 canvas tag.</canvas>
</div>
</div>
</div>
<div class="w3-center">
<div class="progress-bar w3-text-teal">Model is loading...</div>
</div>
<div class="w3-center add-padding w3-border add-margin side-margin w3-round w3-pale-blue">
<h5 class='new-font'></h5>
<ol class='w3-left-align' id='prediction-list'></ol>
</div>
<!-- Button -->
<div id="btnn" class="w3-center bottom-padding">
<button class="w3-btn w3-purple w3-round w3-margin-bottom adjust-spacing w3-hover-red btn-font w3-padding w3-space-letters w3-card-4" onclick="setTimeout(simulateClick.bind(null, 'image-selector'), 200)"></i><b>Submit a Brain Window CT Image</b></button>
<p class="w3-text-teal">jpeg or png</p>
</div>
<div class='w3-padding'>
<p class='w3-round w3-margin w3-margin-bottom w3-text-teal'>Please Note: This is a prototype.</p>
</div>
</div><!--END OF HOME PAGE TAB-->
<!-- We simulate clicks on these two. -->
<div class="hide">
<button id='predict-button'>Predict</button>
</div>
<div class="hide">
<input id="image-selector" type="file">
</div>
<!--===================================-->
<!-- Load jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<!-- Load TensorFlow.js -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.13.3/dist/tf.min.js">
</script>
<!-- NOTE:
Change the predict.js file name (change the number) each time you modify the predict.js file.
This will force the browser to load the latest predict.js and not load
the predict.js file that is in the user's cache.
There is a stackoverflow soulution that says to add a version to the js file.
But it could be that some browsers can ignore the version. Therefore I think
it's safer to change the js file name.-->
<script src="jscript/predict.js"></script>
</div> <!-- w3-content -->
</body>
</html>