srivatsavdamaraju
commited on
Create templates/index.html
Browse files- templates/index.html +160 -0
templates/index.html
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Image Segmentation</title>
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
* {
|
10 |
+
margin: 0;
|
11 |
+
padding: 0;
|
12 |
+
box-sizing: border-box;
|
13 |
+
}
|
14 |
+
|
15 |
+
body {
|
16 |
+
font-family: 'Roboto', sans-serif;
|
17 |
+
background: linear-gradient(135deg, #2c3e50, #4ca1af);
|
18 |
+
color: #ffffff;
|
19 |
+
}
|
20 |
+
|
21 |
+
.navbar {
|
22 |
+
display: flex;
|
23 |
+
justify-content: space-between;
|
24 |
+
padding: 15px 20px;
|
25 |
+
background: rgba(0, 0, 0, 0.7);
|
26 |
+
align-items: center;
|
27 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
28 |
+
}
|
29 |
+
|
30 |
+
.navbar .logo {
|
31 |
+
font-size: 22px;
|
32 |
+
font-weight: 500;
|
33 |
+
color: #fff;
|
34 |
+
letter-spacing: 1.2px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.container {
|
38 |
+
max-width: 800px;
|
39 |
+
margin: 50px auto;
|
40 |
+
text-align: center;
|
41 |
+
background: rgba(255, 255, 255, 0.1);
|
42 |
+
padding: 30px;
|
43 |
+
border-radius: 15px;
|
44 |
+
backdrop-filter: blur(10px);
|
45 |
+
}
|
46 |
+
|
47 |
+
h1 {
|
48 |
+
font-size: 36px;
|
49 |
+
margin-bottom: 20px;
|
50 |
+
color: #ffffff;
|
51 |
+
}
|
52 |
+
|
53 |
+
p {
|
54 |
+
font-size: 18px;
|
55 |
+
margin-bottom: 30px;
|
56 |
+
color: #dddddd;
|
57 |
+
}
|
58 |
+
|
59 |
+
.image-upload {
|
60 |
+
background-color: rgba(255, 255, 255, 0.2);
|
61 |
+
border: 2px dashed #b0b0b0;
|
62 |
+
padding: 80px;
|
63 |
+
border-radius: 15px;
|
64 |
+
position: relative;
|
65 |
+
margin-bottom: 30px;
|
66 |
+
transition: background-color 0.3s ease;
|
67 |
+
}
|
68 |
+
|
69 |
+
.image-upload:hover {
|
70 |
+
background-color: rgba(255, 255, 255, 0.3);
|
71 |
+
}
|
72 |
+
|
73 |
+
.image-placeholder {
|
74 |
+
display: flex;
|
75 |
+
flex-direction: column;
|
76 |
+
align-items: center;
|
77 |
+
}
|
78 |
+
|
79 |
+
.image-placeholder label {
|
80 |
+
background-color: #3a3a3a;
|
81 |
+
color: white;
|
82 |
+
font-size: 18px;
|
83 |
+
padding: 15px 35px;
|
84 |
+
border-radius: 30px;
|
85 |
+
cursor: pointer;
|
86 |
+
display: flex;
|
87 |
+
align-items: center;
|
88 |
+
transition: background-color 0.3s ease;
|
89 |
+
}
|
90 |
+
|
91 |
+
.image-placeholder label:hover {
|
92 |
+
background-color: #4a4a4a;
|
93 |
+
}
|
94 |
+
|
95 |
+
#file-input {
|
96 |
+
display: none;
|
97 |
+
}
|
98 |
+
|
99 |
+
.image-placeholder p {
|
100 |
+
margin-top: 15px;
|
101 |
+
color: #ffffff;
|
102 |
+
font-size: 16px;
|
103 |
+
}
|
104 |
+
|
105 |
+
.image-placeholder button {
|
106 |
+
margin-top: 20px;
|
107 |
+
background-color: #4ca1af;
|
108 |
+
color: white;
|
109 |
+
border: none;
|
110 |
+
padding: 12px 25px;
|
111 |
+
font-size: 16px;
|
112 |
+
border-radius: 25px;
|
113 |
+
cursor: pointer;
|
114 |
+
transition: background-color 0.3s ease;
|
115 |
+
}
|
116 |
+
|
117 |
+
.image-placeholder button:hover {
|
118 |
+
background-color: #2980b9;
|
119 |
+
}
|
120 |
+
|
121 |
+
img {
|
122 |
+
margin-top: 20px;
|
123 |
+
border-radius: 10px;
|
124 |
+
max-width: 100%;
|
125 |
+
height: auto;
|
126 |
+
}
|
127 |
+
</style>
|
128 |
+
</head>
|
129 |
+
<body>
|
130 |
+
<nav class="navbar">
|
131 |
+
<div class="logo">Image Segmentation</div>
|
132 |
+
</nav>
|
133 |
+
|
134 |
+
<div class="container">
|
135 |
+
<h1>Upload an Image for Segmentation</h1>
|
136 |
+
<p>Unleash the Power of AI: Segment Your Images with Precision</p>
|
137 |
+
|
138 |
+
<div class="image-upload">
|
139 |
+
<div class="image-placeholder">
|
140 |
+
<form action="/predict" method="post" enctype="multipart/form-data">
|
141 |
+
<label for="file-input">
|
142 |
+
<span>Select Image</span>
|
143 |
+
</label>
|
144 |
+
<input id="file-input" type="file" name="file" accept="image/*" required />
|
145 |
+
<p>or, drag and drop an image here</p>
|
146 |
+
<button type="submit">Predict</button>
|
147 |
+
</form>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
|
151 |
+
{% if uploaded_image %}
|
152 |
+
<h2>Uploaded Image</h2>
|
153 |
+
<img src="{{ url_for('static', filename='uploads/' + uploaded_image) }}" alt="Uploaded Image">
|
154 |
+
|
155 |
+
<h2>Predicted Image</h2>
|
156 |
+
<img src="{{ url_for('static', filename='uploads/' + predicted_image) }}" alt="Predicted Image">
|
157 |
+
{% endif %}
|
158 |
+
</div>
|
159 |
+
</body>
|
160 |
+
</html>
|