Update static/index.html
Browse files- static/index.html +8 -11
static/index.html
CHANGED
|
@@ -3,18 +3,15 @@
|
|
| 3 |
<head>
|
| 4 |
<title>Face2Vintage</title>
|
| 5 |
<script>
|
| 6 |
-
async function
|
| 7 |
event.preventDefault();
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
});
|
| 16 |
-
|
| 17 |
-
const result = await response.blob();
|
| 18 |
const imageURL = URL.createObjectURL(result);
|
| 19 |
document.getElementById('resultContainer').innerHTML = `<img src="${imageURL}" alt="Result Image">`;
|
| 20 |
} catch (error) {
|
|
|
|
| 3 |
<head>
|
| 4 |
<title>Face2Vintage</title>
|
| 5 |
<script>
|
| 6 |
+
document.getElementById('uploadForm').addEventListener('submit', async function(event) {
|
| 7 |
event.preventDefault();
|
| 8 |
+
const formData = new FormData(this);
|
| 9 |
+
try {
|
| 10 |
+
const response = await fetch('/process_image/', {
|
| 11 |
+
method: 'POST',
|
| 12 |
+
body: formData
|
| 13 |
+
});
|
| 14 |
+
const result = await response.blob();
|
|
|
|
|
|
|
|
|
|
| 15 |
const imageURL = URL.createObjectURL(result);
|
| 16 |
document.getElementById('resultContainer').innerHTML = `<img src="${imageURL}" alt="Result Image">`;
|
| 17 |
} catch (error) {
|