Spaces:
Runtime error
Runtime error
Upload index.html
Browse files- templates/index.html +53 -0
templates/index.html
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title>Image Captioning</title>
|
5 |
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
|
6 |
+
|
7 |
+
<style>
|
8 |
+
.heading{
|
9 |
+
font-weight: 100;
|
10 |
+
font-size: 4em;
|
11 |
+
text-shadow: 1px 1px 5px black;
|
12 |
+
}
|
13 |
+
|
14 |
+
img{
|
15 |
+
height: 90%;
|
16 |
+
width: 100%;
|
17 |
+
}
|
18 |
+
|
19 |
+
.text{
|
20 |
+
font-size: 32px;
|
21 |
+
font-style: italic;
|
22 |
+
}
|
23 |
+
</style>
|
24 |
+
</head>
|
25 |
+
<body>
|
26 |
+
<div class="container">
|
27 |
+
<div class="jumbotron">
|
28 |
+
<div class="container">
|
29 |
+
<h1 class="heading">Image Captioning</h1>
|
30 |
+
<p> Upload your image to generate a caption...</p>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<form class="form-inline" method='POST' action="/" enctype="multipart/form-data">
|
35 |
+
<label><b> Image : </b></label>
|
36 |
+
<input class='form-control' type="file" name="userfile" placeholder="Your image">
|
37 |
+
<button type="submit" class="btn btn-primary"> Submit</button>
|
38 |
+
</form>
|
39 |
+
|
40 |
+
{% if your_result %}
|
41 |
+
<div class="row">
|
42 |
+
<div class="col-sm-4">
|
43 |
+
<img src="{{your_result['image']}}">
|
44 |
+
</div>
|
45 |
+
<div class="col-sm-8">
|
46 |
+
<p class="text"> Generated Caption : </p>
|
47 |
+
<p><b> {{ your_result['caption'] }}</b></p>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
{% endif %}
|
51 |
+
</div>
|
52 |
+
</body>
|
53 |
+
</html>
|