File size: 9,043 Bytes
329fdb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5cc7a6
 
 
 
 
329fdb3
 
 
 
 
 
 
 
 
 
 
 
b5cc7a6
 
329fdb3
 
 
 
 
 
 
b5cc7a6
329fdb3
 
 
 
 
b5cc7a6
 
2779ae0
 
b5cc7a6
 
 
 
35ef2f0
b5cc7a6
 
 
 
2779ae0
 
b5cc7a6
 
 
 
329fdb3
 
186d7fc
b5cc7a6
 
 
 
 
 
 
 
186d7fc
96c0b65
b5cc7a6
 
 
 
 
 
 
 
 
186d7fc
96c0b65
b5cc7a6
 
 
 
 
 
 
 
 
186d7fc
96c0b65
186d7fc
b5cc7a6
 
 
 
 
 
 
 
186d7fc
96c0b65
186d7fc
b5cc7a6
 
 
 
 
 
 
 
186d7fc
96c0b65
186d7fc
b5cc7a6
 
 
 
 
 
 
 
186d7fc
96c0b65
186d7fc
b5cc7a6
 
 
 
 
 
 
 
186d7fc
329fdb3
 
 
 
186d7fc
b5cc7a6
329fdb3
 
 
b5cc7a6
329fdb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5cc7a6
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Processed Results</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
    <style>
        body {
            background-color: #1c1c1e;
            font-family: "Poppins", sans-serif;
            color: #f5f5f7;
        }

        h1 {
            color: #e5e5e7;
            text-align: center;
        }

        .cont {
            background-color: #2c2c2e;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
            transition: 1s ease;
        }

        .section-title {
            color: #ee4410;
            font-size: 1.5rem;
            font-weight: bold;
            margin-top: 20px;
            border-bottom: 2px solid #ee4410;
            padding-bottom: 10px;
        }

        .card {
            background-color: #3a3a3c;
            color: #f5f5f7;
            border-radius: 10px;
            margin-bottom: 15px;
            padding: 15px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            transition: background-color 0.3s ease;
        }

        .card:hover {
            background-color: #3a3a3c98;
        }

        .card-title {
            color: #ee4410;
            font-size: 1.2rem;
            font-weight: bold;
        }

        .card-text {
            color: #d1d1d6;
            font-size: 1rem;
        }

        ul {
            list-style-type: none;
            padding-left: 0;
        }

        li::before {
            content: "• ";
            color: #ee4410;
        }

        .btn-reset {
            background-color: #ff9f0a;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            transition: background-color 0.3s ease;
            margin-bottom: 20px;
        }

        .btn-reset:hover {
            background-color: #e03a2f;
        }

        .alert {
            text-align: center;
            position: absolute;
            top: 0;
            right: 15%;
        }

        .image-container img {
            max-width: 100%;
            border-radius: 10px;
        }
    </style>
</head>

<body>
    <div class="container">
        {% with messages = get_flashed_messages() %} {% if messages %}
        <div class="alert alert-success mt-4 " id="flash-message">
            {{ messages[0] }}
        </div>
        {% endif %} {% endwith %}
    </div>

    <div class="container cont mt-5">
        <div class="d-flex align-items-center justify-content-between">
            <h1>Extracted Details From Image</h1>
            <!-- Reset Button -->
            <div class="text-center mt-4">
                <a href="{{ url_for('reset_upload') }}" class="btn btn-reset">Reset & Upload New File</a>
            </div>
        </div>

        {% if data %}
        <!-- Personal Information Section -->
        <section>
            <h3 class="section-title">Extracted Information</h3>
            <div class="row">
                <!-- Image Container on the Left -->
                <div class="col-md-6 image-container">
                   <div class="card">
                        <div class="card-body">
                    {% if data.extracted_text.items() %}
                    <h5 class="card-title">Extracted Image:</h5>
                    <ul>
                        {% for filename, text in data.extracted_text.items() %}
                        <!--<li>{{ filename }}:</li>-->
                        <img src="{{ Img[filename] }}" alt="Processed Image" class="img-fluid" />
                        {% endfor %}
                    </ul>
                    {% endif %}
                          </div>
                     </div>
                </div>

                <!-- Extracted Text on the Right -->
                <div class="col-md-6">
                    <div class="card">
                        <div class="card-body">
                            {% if data.name and data.name is iterable and data.name is not string %}
                            <h5 class="card-title">Name:</h5>
                            <ul>
                                {% for value in data.name %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}

                            {% if data.Designation and data.Designation is iterable and data.Designation is not string %}
                            <h5 class="card-title">Designation:</h5>
                            <ul>
                                {% for value in data.Designation %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}

                            {% if data.contact_number and data.contact_number is iterable and data.contact_number is not string %}
                            <h5 class="card-title">Contact number:</h5>
                            <ul>
                                {% for value in data.contact_number %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}

                            {% if data.email and data.email is iterable and data.email is not string %}
                            <h5 class="card-title">Email:</h5>
                            <ul>
                                {% for value in data.email %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}

                            {% if data.Location and data.Location is iterable and data.Location is not string %}
                            <h5 class="card-title">Location:</h5>
                            <ul>
                                {% for value in data.Location %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}

                            {% if data.Link and data.Link is iterable and data.Link is not string %}
                            <h5 class="card-title">Link:</h5>
                            <ul>
                                {% for value in data.Link %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}

                            {% if data.Company and data.Company is iterable and data.Company is not string %}
                            <h5 class="card-title">Organisation:</h5>
                            <ul>
                                {% for value in data.Company %}
                                {% if value|lower != 'not found' %}
                                <li>{{ value }}</li>
                                {% endif %}
                                {% endfor %}
                            </ul>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </section>

        {% else %}
        <p>No data available. Please process a file.</p>
        {% endif %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
    <script>
        setTimeout(function () {
            let flashMessage = document.getElementById("flash-message");
            if (flashMessage) {
                flashMessage.style.transition = "opacity 1s ease";
                flashMessage.style.opacity = 0;
                setTimeout(() => flashMessage.remove(), 1000);
            }
        }, 3000);
    </script>
</body>

</html>