kshipra-jadav
add total faces counter
9f60c09
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* common.css */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-image: url('https://www.gsfcuni.edu.in/upload/slider/php949D_NcK1628833893.jpeg');
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
nav {
background-color: #212529;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
}
nav img {
max-width: 100%;
height: auto;
}
nav ul {
list-style-type: none;
display: flex;
flex-wrap: wrap;
/* Added for mobile responsiveness */
}
nav ul li {
margin-right: 20px;
margin-bottom: 10px;
/* Added for mobile responsiveness */
}
nav ul li a {
text-decoration: none;
color: #fff;
font-weight: bold;
transition: color 0.3s ease;
}
nav ul li a:hover {
color: #ff5733;
}
section {
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
margin: 20px;
}
h1 {
color: #1b2850;
margin-bottom: 20px;
}
footer {
background-color: rgba(27, 40, 80, 1);
color: #fff;
text-align: center;
padding: 10px;
position: fixed;
bottom: 0;
width: 100%;
}
.carousel-caption {
position: absolute;
right: 15%;
bottom: 20%;
left: 15%;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
background-color: rgba(0, 0, 0, 0.084);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
border: 0px solid rgba(0, 0, 0, 0.2);
border-radius: 4px;
}
.carousel-caption h3 {
font-size: 100px;
font-weight: 700;
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
margin-top: 0;
margin-bottom: 0;
}
span {
font-size: 70px;
color: #26386e;
font-weight: bold;
}
/* upload.css */
.upload-section {
background-color: #f5f5f5;
text-align: center;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
opacity: 1;
}
#imageUpload {
display: block;
margin: 0 auto;
padding: 10px;
border: 2px dashed #ccc;
border-radius: 10px;
background-color: #fff;
cursor: pointer;
}
#imageUpload:hover {
border-color: #1b2850;
}
#imageUploadLabel {
display: block;
font-weight: bold;
margin-top: 10px;
}
#imagePreview {
max-width: 100%;
margin-top: 20px;
border-radius: 10px;
}
/* custom.css */
#imagePreviewContainer {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 10px;
padding: 20px;
margin-top: 20px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}
#imagePreviewContainer h2 {
color: #1b2850;
font-size: 24px;
font-weight: bold;
}
#imagePreview {
max-width: 100%;
height: auto;
margin-top: 10px;
border: 2px solid #1b2850;
border-radius: 5px;
}
#previewButton {
background-color: #1b2850;
color: #fff;
border: none;
padding: 10px 20px;
margin-top: 10px;
font-size: 16px;
font-weight: bold;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
#previewButton:hover {
background-color: #ff5733;
}
@media only screen and (max-width: 768px) {
.carousel-caption {
font-size: 24px;
}
.carousel-caption h3 {
font-size: 50px;
}
span {
font-size: 40px;
}
#previewButton {
font-size: 14px;
}
}
</style>
<title>Page 1</title>
</head>
<body>
<nav>
<img src="https://www.gsfcuni.edu.in/public/logo/White1.png" alt="Logo">
<ul>
<li><a href="/">Image</a></li>
<li><a href="/camera">Camera</a></li>
</ul>
</nav>
<section class="upload-section">
<h1>UPLOAD</h1>
<label for="imageUpload" id="imageUploadLabel">Choose an image</label>
<form method="post" action="/detect_faces" enctype="multipart/form-data">
<input type="file" id="imageUpload" name="img_upload" accept="image/*">
<input type="submit" value="Submit Form" id="previewButton">
</form>
<div id="imagePreviewContainer">
{% if img_data: %}
<h3>Total Faces {{faces}}</h3>
<h2>Image Preview</h2>
<div>
<img id="imagePreview" src="data:image/jpeg;base64,{{ img_data }}" width="800" height="600">
</div>
{% endif %}
</div>
</section>
<footer>
Developed by Kshipra and Viraj
</footer>
</body>
</html>