Spaces:
Sleeping
Sleeping
Upload static_index (22).html
Browse files- static_index (22).html +61 -0
static_index (22).html
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!-- index.html -->
|
2 |
+
|
3 |
+
<!DOCTYPE html>
|
4 |
+
<html lang="en">
|
5 |
+
<head>
|
6 |
+
<meta charset="UTF-8">
|
7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
8 |
+
<title>Image Enhancement</title>
|
9 |
+
<style>
|
10 |
+
/* Style to make the image smaller */
|
11 |
+
#resultContainer img {
|
12 |
+
max-width: 100%;
|
13 |
+
height: auto;
|
14 |
+
}
|
15 |
+
</style>
|
16 |
+
</head>
|
17 |
+
<body>
|
18 |
+
<h1>Image Enhancement</h1>
|
19 |
+
<form id="uploadForm" enctype="multipart/form-data">
|
20 |
+
<label for="image">Upload Image:</label>
|
21 |
+
<input type="file" id="image" name="file" accept="image/*" required><br><br>
|
22 |
+
|
23 |
+
<label for="version">Select Version:</label>
|
24 |
+
<select id="version" name="version">
|
25 |
+
<option value="v1.2">v1.2</option>
|
26 |
+
<option value="v1.3">v1.3</option>
|
27 |
+
<option value="v1.4">v1.4</option>
|
28 |
+
<!-- Add more options as needed -->
|
29 |
+
</select><br><br>
|
30 |
+
|
31 |
+
<label for="scale">Select Scale:</label>
|
32 |
+
<select id="scale" name="scale">
|
33 |
+
<option value="2">2x</option>
|
34 |
+
<option value="4">4x</option>
|
35 |
+
<!-- Add more options as needed -->
|
36 |
+
</select><br><br>
|
37 |
+
|
38 |
+
<button type="submit">Enhance Image</button>
|
39 |
+
</form>
|
40 |
+
|
41 |
+
<div id="resultContainer"></div>
|
42 |
+
|
43 |
+
<script>
|
44 |
+
document.getElementById('uploadForm').addEventListener('submit', async function(event) {
|
45 |
+
event.preventDefault();
|
46 |
+
const formData = new FormData(this);
|
47 |
+
try {
|
48 |
+
const response = await fetch('/upload/', {
|
49 |
+
method: 'POST',
|
50 |
+
body: formData
|
51 |
+
});
|
52 |
+
const result = await response.blob();
|
53 |
+
const imageURL = URL.createObjectURL(result);
|
54 |
+
document.getElementById('resultContainer').innerHTML = `<img src="${imageURL}" alt="Enhanced Image">`;
|
55 |
+
} catch (error) {
|
56 |
+
console.error('Error:', error);
|
57 |
+
}
|
58 |
+
});
|
59 |
+
</script>
|
60 |
+
</body>
|
61 |
+
</html>
|