Spaces:
Running
Running
File size: 1,135 Bytes
30de1f3 93c87da 30de1f3 93c87da 30de1f3 93c87da 30de1f3 93c87da 30de1f3 93c87da 30de1f3 e5073bf 30de1f3 9f7a699 30de1f3 6c59b39 93c87da |
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 |
<!-- templates/index.html -->
<!DOCTYPE html>
<html>
<head>
<title>OCR App</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<div class="container">
<h1>Image Text Extraction</h1>
<p>Upload an image to extract text using PaddleOCR.</p>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class="flashes">
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<form method="POST" enctype="multipart/form-data">
<input type="file" name="image" accept="image/*" required>
<button type="submit">Extract Text</button>
</form>
{% if extracted_text %}
<div class="result">
<h2>Extracted Text:</h2>
<pre>{{ extracted_text }}</pre>
</div>
{% endif %}
{% if image_file %}
<div class="image-preview">
<h2>Uploaded Image:</h2>
<img src="{{ url_for('static', filename='uploads/' + image_file) }}" alt="Uploaded Image">
</div>
{% endif %}
</div>
</body>
</html>
|