Spaces:
Running
Running
<!-- templates/index.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> | |