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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
</head>
|
| 10 |
-
<body
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
<p class="text-gray-600 text-sm mt-2">Medium-sized flowers with deep blue or violet color. Commonly found in wetlands and meadows.</p>
|
| 65 |
-
</div>
|
| 66 |
-
</div>
|
| 67 |
-
<!-- Virginica -->
|
| 68 |
-
<div class="bg-white shadow-md rounded-xl overflow-hidden">
|
| 69 |
-
<img src="https://upload.wikimedia.org/wikipedia/commons/4/41/Iris_virginica.jpg" alt="Iris Virginica" class="h-48 w-full object-cover">
|
| 70 |
-
<div class="p-4">
|
| 71 |
-
<h3 class="text-xl font-semibold text-purple-700">Iris Virginica</h3>
|
| 72 |
-
<p class="text-gray-600 text-sm mt-2">Larger flowers, blue to purple in color with bright yellow markings. Found in swamps and coastal areas.</p>
|
| 73 |
</div>
|
| 74 |
-
</div>
|
| 75 |
</div>
|
| 76 |
-
</section>
|
| 77 |
-
|
| 78 |
-
<footer class="mt-12 py-6 text-center text-sm text-gray-500">
|
| 79 |
-
© 2025 Iris Flower Predictor
|
| 80 |
-
</footer>
|
| 81 |
</body>
|
| 82 |
-
</html>
|
|
|
|
| 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>Iris Flower Predictor 🌸</title>
|
| 7 |
+
<style>
|
| 8 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
|
| 9 |
+
|
| 10 |
+
:root {
|
| 11 |
+
--primary-color: #4a90e2;
|
| 12 |
+
--secondary-color: #f6f8fa;
|
| 13 |
+
--text-color: #333;
|
| 14 |
+
--card-bg: #fff;
|
| 15 |
+
--shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
| 16 |
+
--border-radius: 12px;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
body {
|
| 20 |
+
font-family: 'Poppins', sans-serif;
|
| 21 |
+
background-color: var(--secondary-color);
|
| 22 |
+
color: var(--text-color);
|
| 23 |
+
display: flex;
|
| 24 |
+
justify-content: center;
|
| 25 |
+
align-items: center;
|
| 26 |
+
min-height: 100vh;
|
| 27 |
+
margin: 0;
|
| 28 |
+
padding: 20px;
|
| 29 |
+
box-sizing: border-box;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
.container {
|
| 33 |
+
display: flex;
|
| 34 |
+
flex-direction: column;
|
| 35 |
+
gap: 24px;
|
| 36 |
+
max-width: 900px;
|
| 37 |
+
width: 100%;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.header {
|
| 41 |
+
text-align: center;
|
| 42 |
+
margin-bottom: 20px;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.header h1 {
|
| 46 |
+
font-size: 2.5em;
|
| 47 |
+
color: var(--primary-color);
|
| 48 |
+
margin: 0;
|
| 49 |
+
font-weight: 600;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
.main-content {
|
| 53 |
+
display: flex;
|
| 54 |
+
flex-direction: column;
|
| 55 |
+
gap: 24px;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.card {
|
| 59 |
+
background-color: var(--card-bg);
|
| 60 |
+
padding: 24px;
|
| 61 |
+
border-radius: var(--border-radius);
|
| 62 |
+
box-shadow: var(--shadow);
|
| 63 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.card:hover {
|
| 67 |
+
transform: translateY(-5px);
|
| 68 |
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.form-section {
|
| 72 |
+
flex: 1;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.image-and-info {
|
| 76 |
+
flex: 1;
|
| 77 |
+
display: flex;
|
| 78 |
+
flex-direction: column;
|
| 79 |
+
gap: 24px;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.iris-image img {
|
| 83 |
+
width: 100%;
|
| 84 |
+
border-radius: var(--border-radius);
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.info-section {
|
| 88 |
+
display: flex;
|
| 89 |
+
flex-direction: column;
|
| 90 |
+
gap: 16px;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.info-section h2 {
|
| 94 |
+
font-size: 1.5em;
|
| 95 |
+
color: var(--primary-color);
|
| 96 |
+
margin-top: 0;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.species-list {
|
| 100 |
+
list-style: none;
|
| 101 |
+
padding: 0;
|
| 102 |
+
margin: 0;
|
| 103 |
+
display: flex;
|
| 104 |
+
flex-direction: column;
|
| 105 |
+
gap: 12px;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
.species-list li {
|
| 109 |
+
background-color: var(--secondary-color);
|
| 110 |
+
padding: 12px;
|
| 111 |
+
border-radius: 8px;
|
| 112 |
+
border-left: 4px solid var(--primary-color);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.species-list li strong {
|
| 116 |
+
display: block;
|
| 117 |
+
margin-bottom: 4px;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
form {
|
| 121 |
+
display: flex;
|
| 122 |
+
flex-direction: column;
|
| 123 |
+
gap: 16px;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
label {
|
| 127 |
+
font-weight: 600;
|
| 128 |
+
margin-bottom: 4px;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
input[type="text"] {
|
| 132 |
+
width: 100%;
|
| 133 |
+
padding: 10px;
|
| 134 |
+
border: 1px solid #ccc;
|
| 135 |
+
border-radius: 8px;
|
| 136 |
+
box-sizing: border-box;
|
| 137 |
+
transition: border-color 0.3s;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
input[type="text"]:focus {
|
| 141 |
+
outline: none;
|
| 142 |
+
border-color: var(--primary-color);
|
| 143 |
+
box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
input[type="submit"] {
|
| 147 |
+
background-color: var(--primary-color);
|
| 148 |
+
color: white;
|
| 149 |
+
padding: 12px 20px;
|
| 150 |
+
border: none;
|
| 151 |
+
border-radius: 8px;
|
| 152 |
+
cursor: pointer;
|
| 153 |
+
font-size: 1em;
|
| 154 |
+
font-weight: 600;
|
| 155 |
+
transition: background-color 0.3s ease;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
input[type="submit"]:hover {
|
| 159 |
+
background-color: #357abd;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
.result-section {
|
| 163 |
+
text-align: center;
|
| 164 |
+
font-size: 1.2em;
|
| 165 |
+
font-weight: 600;
|
| 166 |
+
margin-top: 16px;
|
| 167 |
+
padding: 16px;
|
| 168 |
+
background-color: #e8f5e9;
|
| 169 |
+
color: #2e7d32;
|
| 170 |
+
border-radius: var(--border-radius);
|
| 171 |
+
display: {% if result %} block {% else %} none {% endif %};
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
@media (min-width: 768px) {
|
| 175 |
+
.container {
|
| 176 |
+
flex-direction: row;
|
| 177 |
+
gap: 32px;
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
.main-content {
|
| 181 |
+
flex-direction: row;
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
</style>
|
| 185 |
</head>
|
| 186 |
+
<body>
|
| 187 |
+
<div class="container">
|
| 188 |
+
<div class="main-content">
|
| 189 |
+
<div class="form-section card">
|
| 190 |
+
<div class="header">
|
| 191 |
+
<h1>Iris Flower Predictor</h1>
|
| 192 |
+
<p>Enter the measurements to predict the species.</p>
|
| 193 |
+
</div>
|
| 194 |
+
<form action="/predict" method="post">
|
| 195 |
+
<div>
|
| 196 |
+
<label for="sl">Sepal Length (cm)</label>
|
| 197 |
+
<input type="text" id="sl" name="sl" placeholder="e.g., 5.1" required>
|
| 198 |
+
</div>
|
| 199 |
+
<div>
|
| 200 |
+
<label for="sw">Sepal Width (cm)</label>
|
| 201 |
+
<input type="text" id="sw" name="sw" placeholder="e.g., 3.5" required>
|
| 202 |
+
</div>
|
| 203 |
+
<div>
|
| 204 |
+
<label for="pl">Petal Length (cm)</label>
|
| 205 |
+
<input type="text" id="pl" name="pl" placeholder="e.g., 1.4" required>
|
| 206 |
+
</div>
|
| 207 |
+
<div>
|
| 208 |
+
<label for="pw">Petal Width (cm)</label>
|
| 209 |
+
<input type="text" id="pw" name="pw" placeholder="e.g., 0.2" required>
|
| 210 |
+
</div>
|
| 211 |
+
<input type="submit" value="Predict Species">
|
| 212 |
+
</form>
|
| 213 |
+
{% if result %}
|
| 214 |
+
<div class="result-section">
|
| 215 |
+
<p>Predicted Flower Species is: <strong>{{ result }}</strong></p>
|
| 216 |
+
</div>
|
| 217 |
+
{% endif %}
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<div class="image-and-info">
|
| 221 |
+
<div class="iris-image card">
|
| 222 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/5/56/Iris_versicolor_3.jpg" alt="A beautiful Iris flower" loading="lazy">
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<div class="info-section card">
|
| 226 |
+
<h2>About the Iris Species</h2>
|
| 227 |
+
<ul class="species-list">
|
| 228 |
+
<li>
|
| 229 |
+
<strong>Iris Setosa:</strong> Usually has the shortest and widest petals and sepals. Its flowers are typically bright blue-violet.
|
| 230 |
+
</li>
|
| 231 |
+
<li>
|
| 232 |
+
<strong>Iris Versicolor:</strong> A transitional species with medium-sized petals and sepals. Often has a variety of colors, from blue-violet to yellow.
|
| 233 |
+
</li>
|
| 234 |
+
<li>
|
| 235 |
+
<strong>Iris Virginica:</strong> Tends to have the longest petals and sepals, making it the largest of the three. Flowers are typically a darker blue or violet.
|
| 236 |
+
</li>
|
| 237 |
+
</ul>
|
| 238 |
+
</div>
|
| 239 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
</div>
|
|
|
|
| 241 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
</body>
|
| 243 |
+
</html>
|