|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Scan Result</title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@600&display=swap" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
font-family: 'Orbitron', sans-serif;
|
|
background: radial-gradient(circle at center, #050b14 0%, #000000 100%);
|
|
color: #e0f2ff;
|
|
text-align: center;
|
|
padding: 2rem;
|
|
margin: 0;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
|
|
.space-bg {
|
|
position: fixed;
|
|
top: 0; left: 0;
|
|
width: 100vw; height: 100vh;
|
|
z-index: -1;
|
|
background: radial-gradient(ellipse at center, #0c1a2b, #000);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.star {
|
|
position: absolute;
|
|
width: 2px;
|
|
height: 2px;
|
|
background: white;
|
|
border-radius: 50%;
|
|
animation: twinkle 3s infinite ease-in-out;
|
|
}
|
|
|
|
@keyframes twinkle {
|
|
0%, 100% { opacity: 0.2; transform: scale(1); }
|
|
50% { opacity: 1; transform: scale(1.5); }
|
|
}
|
|
|
|
.uploaded-image {
|
|
max-width: 600px;
|
|
width: 100%;
|
|
height: auto;
|
|
border-radius: 1rem;
|
|
margin: 1rem 0;
|
|
box-shadow: 0 0 20px #00eaff;
|
|
}
|
|
|
|
.result-box {
|
|
margin-top: 1.5rem;
|
|
background: rgba(0, 255, 255, 0.07);
|
|
padding: 1.8rem;
|
|
border-radius: 1.5rem;
|
|
box-shadow: 0 0 25px rgba(0, 255, 255, 0.15);
|
|
max-width: 700px;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
}
|
|
|
|
.btn {
|
|
padding: 0.8rem 2rem;
|
|
background: #00bfff;
|
|
border: none;
|
|
color: white;
|
|
font-size: 1.1rem;
|
|
border-radius: 1rem;
|
|
margin-top: 2rem;
|
|
cursor: pointer;
|
|
box-shadow: 0 0 20px #00eaff;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.btn:hover {
|
|
box-shadow: 0 0 30px #00ffff;
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
.score, .highlight {
|
|
font-size: 1.3rem;
|
|
margin: 0.6rem 0;
|
|
}
|
|
|
|
.highlight span {
|
|
color: #00eaff;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.risk-level {
|
|
font-size: 1.5rem;
|
|
margin-top: 1.5rem;
|
|
}
|
|
|
|
.risk-low { color: #6aff6a; }
|
|
.risk-medium { color: #ffe066; }
|
|
.risk-high { color: #ff4d4d; }
|
|
|
|
.combined-risk-box {
|
|
margin-top: 1.5rem;
|
|
font-size: 1.8rem;
|
|
color: #00ffff;
|
|
font-weight: bold;
|
|
text-shadow: 0 0 10px #00ffff;
|
|
}
|
|
|
|
.info-box {
|
|
margin-top: 1rem;
|
|
font-size: 1.05rem;
|
|
color: #9cefff;
|
|
}
|
|
|
|
summary {
|
|
cursor: pointer;
|
|
font-size: 1.1rem;
|
|
color: #00eaff;
|
|
}
|
|
|
|
details p {
|
|
margin-top: 1rem;
|
|
line-height: 1.6;
|
|
font-size: 0.95rem;
|
|
color: #c4f1ff;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="space-bg" id="space-bg"></div>
|
|
|
|
<h1>🔬 AI Scan Result</h1>
|
|
|
|
<p>🧪 Original Image:</p>
|
|
<img src="{{ url_for('static', filename='uploads/' + filename) }}" class="uploaded-image" alt="Original Image">
|
|
|
|
<h2>🧬 Image with Detection:</h2>
|
|
<img src="{{ url_for('static', filename=marked_filename) }}" class="uploaded-image" alt="Detected Image">
|
|
|
|
<div class="result-box">
|
|
<div class="highlight">🧬 ปกเซลล์ผิดปกติ (Blast): <span>{{ abnormal_cells }}</span> เซลล์</div>
|
|
<div class="highlight">➡️ ความเสี่ยงจาก Blast = <span class="count" data-target="{{ blast_risk }}">0</span>%</div>
|
|
<div class="highlight">🧠 HuggingFace Model: <span class="count" data-target="{{ huggingface_score }}">0</span>% โอกาสเป็นลูคีเมีย</div>
|
|
|
|
<div class="risk-level {% if combined_risk < 20 %}risk-low{% elif combined_risk < 60 %}risk-medium{% else %}risk-high{% endif %}">
|
|
✅ สรุปผล: ความเสี่ยงระดับ
|
|
<strong>
|
|
{% if combined_risk < 20 %}ต่ำ
|
|
{% elif combined_risk < 60 %}ปานกลาง
|
|
{% else %}สูง
|
|
{% endif %}
|
|
</strong>
|
|
</div>
|
|
|
|
<div class="combined-risk-box">💡 ความเสี่ยงรวม: <span class="count" data-target="{{ combined_risk }}">0</span>%</div>
|
|
<div class="info-box">📋 ปัจจัยเสริม: {{ sex }} อายุ {{ age }} ปี</div>
|
|
</div>
|
|
|
|
<a href="/" class="btn">🔁 Scan Another</a>
|
|
|
|
<details style="margin-top: 2rem;">
|
|
<summary>❓ อธิบายผลการตรวจ</summary>
|
|
<p>
|
|
🔹 <strong>ความเสี่ยงจาก Blast</strong>: คำนวณจากจำนวนเซลล์เม็ดเลือดขาวที่มีลักษณะผิดปกติ (Blast) เทียบกับเซลล์เม็ดเลือดขาวทั้งหมดที่ตรวจพบในภาพ<br><br>
|
|
🔹 <strong>HuggingFace Model</strong>: วิเคราะห์ภาพรวมด้วยโมเดล AI ที่ผ่านการเทรนมาสำหรับแยกแยะภาพกลุ่มผู้ป่วยลูคีเมียและไม่เป็นลูคีเมีย โดยประเมินความเสี่ยงจากมุมมองรวมของภาพ<br><br>
|
|
📌 หากค่าทั้งสองมีความต่างกันมาก แนะนำให้ปรึกษาแพทย์เพื่อยืนยันผล และไม่ควรตัดสินใจรักษาโดยยึดจาก AI เพียงอย่างเดียว
|
|
</p>
|
|
</details>
|
|
|
|
|
|
<script>
|
|
const counters = document.querySelectorAll('.count');
|
|
counters.forEach(counter => {
|
|
counter.innerText = '0';
|
|
const update = () => {
|
|
const target = +counter.getAttribute('data-target');
|
|
const current = +counter.innerText;
|
|
const increment = target / 60;
|
|
|
|
if (current < target) {
|
|
counter.innerText = (current + increment).toFixed(1);
|
|
setTimeout(update, 20);
|
|
} else {
|
|
counter.innerText = target.toFixed(1);
|
|
}
|
|
};
|
|
update();
|
|
});
|
|
|
|
|
|
const bg = document.getElementById('space-bg');
|
|
for (let i = 0; i < 80; i++) {
|
|
const star = document.createElement('div');
|
|
star.classList.add('star');
|
|
star.style.top = `${Math.random() * 100}vh`;
|
|
star.style.left = `${Math.random() * 100}vw`;
|
|
star.style.animationDuration = `${Math.random() * 3 + 2}s`;
|
|
star.style.opacity = Math.random();
|
|
bg.appendChild(star);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|