File size: 2,547 Bytes
b398c5e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Prediction Result</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}?v=12022025">
</head>
<body>
    
    <div class="animated-bg"></div>

    <div class="main-box result container">
        
        <h1 class="title">✅ Final Prediction</h1>
        
        <h2 class="risk-level risk-{{ final_risk_level.lower().replace(' ', '-') }}">
            Final Risk: {{ final_risk_level }}
        </h2>
        <p class="subtitle"><strong>Combined Score:</strong> {{ combined_score }}%</p>
        
        <hr>
        
        <h3>Component Analysis Scores</h3>
        <ul class="score-summary">
            <li><strong>Tabular Confidence (Form Data):</strong> <span>{{ confidence }}%</span></li>
            <li><strong>OCR Report Risk Score:</strong> <span>{{ ocr_score }}</span> (Max 1.0)</li>
            <li><strong>CNN X-ray Risk Score:</strong> <span>{{ cnn_score }}%</span></li>
        </ul>

        {% if gradcam_image_url %}
            <div class="keyword-section" style="text-align:center; margin-top: 30px; padding: 20px;">
                <h3>🔬 Model Focus Visualization (Grad-CAM)</h3>
                <p class="subtitle">This heatmap highlights the regions the AI focused on in the X-ray for prediction.</p>
                
                <img src="{{ url_for('static', filename=gradcam_image_url) }}" 

                     alt="AI Focus Heatmap" 

                     style="width:100%; max-width:400px; border-radius:10px; margin-top:15px; box-shadow: 0 0 15px #00c6ff;">
            </div>
        {% endif %}
        
        <div class="keyword-section">
            <h3>Keywords Detected in Report</h3>
            {% if ocr_keywords %}
                <ul class="keywords-list">
                    {% for keyword in ocr_keywords %}
                        <li>✅ {{ keyword }}</li>
                    {% endfor %}
                </ul>
            {% else %}
                <p style="color:#aaa;">No keywords detected or report not processed.</p>
            {% endif %}
        </div>

        <hr>
        
        {% if error_message %}
            <p class="error-message">🚨 {{ error_message }}</p>
        {% endif %}

        <a href="{{ url_for('home') }}" class="glow-btn" 

           style="display:block; text-decoration:none; margin-top: 20px;">
            START NEW ASSESSMENT
        </a>
    </div>
</body>
</html>