Update static/index.html
Browse files- static/index.html +5 -10
static/index.html
CHANGED
@@ -4,23 +4,18 @@
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Image Captioning</title>
|
7 |
-
<style>
|
8 |
-
.result {
|
9 |
-
margin-top: 20px;
|
10 |
-
}
|
11 |
-
</style>
|
12 |
</head>
|
13 |
<body>
|
14 |
<h1>Image Captioning</h1>
|
15 |
-
<form id="uploadForm" action="/
|
16 |
<label for="image">Upload Image:</label><br>
|
17 |
<input type="file" id="image" name="image" accept="image/*"><br>
|
18 |
-
<label for="
|
19 |
-
<
|
20 |
<button type="submit">Submit</button>
|
21 |
</form>
|
22 |
|
23 |
-
<div id="result"
|
24 |
<h2>Result:</h2>
|
25 |
<p id="caption"></p>
|
26 |
</div>
|
@@ -30,7 +25,7 @@
|
|
30 |
event.preventDefault();
|
31 |
|
32 |
let formData = new FormData(this);
|
33 |
-
let response = await fetch('/
|
34 |
method: 'POST',
|
35 |
body: formData
|
36 |
});
|
|
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
<title>Image Captioning</title>
|
|
|
|
|
|
|
|
|
|
|
7 |
</head>
|
8 |
<body>
|
9 |
<h1>Image Captioning</h1>
|
10 |
+
<form id="uploadForm" action="/predict/" method="post" enctype="multipart/form-data">
|
11 |
<label for="image">Upload Image:</label><br>
|
12 |
<input type="file" id="image" name="image" accept="image/*"><br>
|
13 |
+
<label for="question">Question:</label><br>
|
14 |
+
<input type="text" id="question" name="question"><br>
|
15 |
<button type="submit">Submit</button>
|
16 |
</form>
|
17 |
|
18 |
+
<div id="result">
|
19 |
<h2>Result:</h2>
|
20 |
<p id="caption"></p>
|
21 |
</div>
|
|
|
25 |
event.preventDefault();
|
26 |
|
27 |
let formData = new FormData(this);
|
28 |
+
let response = await fetch('http://localhost:8000/predict/', {
|
29 |
method: 'POST',
|
30 |
body: formData
|
31 |
});
|