Spaces:
Running
Running
Update index.html
Browse files- index.html +13 -2
index.html
CHANGED
@@ -77,7 +77,7 @@
|
|
77 |
<div class="spinner"></div>
|
78 |
</div>
|
79 |
|
80 |
-
<div id="dropArea"
|
81 |
<p>Drag and drop an OCT image file here, or click to select file</p>
|
82 |
</div>
|
83 |
|
@@ -131,10 +131,21 @@
|
|
131 |
const prediction = await model.predict(reshapedExample);
|
132 |
const class_scores = await prediction.data();
|
133 |
const max_score_id = class_scores.indexOf(Math.max(...class_scores));
|
134 |
-
const classes = ["Central Serous Chorioretinopathy (CSCR)", "CSCR complicated with MNV", "
|
135 |
document.getElementById('result').innerHTML = classes[max_score_id].toString();
|
136 |
document.getElementById('loadingOverlay').style.display = 'none'; // Hide loading overlay
|
137 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
</script>
|
139 |
</body>
|
140 |
</html>
|
|
|
77 |
<div class="spinner"></div>
|
78 |
</div>
|
79 |
|
80 |
+
<div id="dropArea">
|
81 |
<p>Drag and drop an OCT image file here, or click to select file</p>
|
82 |
</div>
|
83 |
|
|
|
131 |
const prediction = await model.predict(reshapedExample);
|
132 |
const class_scores = await prediction.data();
|
133 |
const max_score_id = class_scores.indexOf(Math.max(...class_scores));
|
134 |
+
const classes = ["Central Serous Chorioretinopathy (CSCR)", "CSCR complicated with MNV", "Polypoidal Choroidal Vasculopathy", "Normal"];
|
135 |
document.getElementById('result').innerHTML = classes[max_score_id].toString();
|
136 |
document.getElementById('loadingOverlay').style.display = 'none'; // Hide loading overlay
|
137 |
}
|
138 |
+
|
139 |
+
// Add event listeners for drag and drop
|
140 |
+
const dropArea = document.getElementById('dropArea');
|
141 |
+
dropArea.addEventListener('dragover', (event) => {
|
142 |
+
event.preventDefault();
|
143 |
+
dropArea.classList.add('dragover');
|
144 |
+
});
|
145 |
+
dropArea.addEventListener('dragleave', () => {
|
146 |
+
dropArea.classList.remove('dragover');
|
147 |
+
});
|
148 |
+
dropArea.addEventListener('drop', handleDrop);
|
149 |
</script>
|
150 |
</body>
|
151 |
</html>
|