Skip to content

Commit e512cce

Browse files
authored
Update homepage.html
1 parent fe25152 commit e512cce

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

codelabs/flex_and_vision/templates/homepage.html

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Bootstrap CSS -->
99
<link rel="stylesheet" href="/static/bootstrap.min.css">
1010

11-
<title>Google Cloud Platform - Face Detection Sample</title>
11+
<title>Emotion analysis on photo</title>
1212
</head>
1313
<body>
1414

@@ -17,10 +17,7 @@
1717
<div class="collapse" id="navbarToggleExternalContent">
1818
<div class="bg-light p-4">
1919
<h5 class="text-dark h4">Happiness Level</h5>
20-
<h1 class="text-muted">Google Cloud Platform - Face Detection Sample</h1>
21-
<p class="text-muted">This Python Flask application demonstrates App Engine Flexible, Google Cloud
22-
Storage, Datastore, and the Cloud Vision API.</p>
23-
<span class="text-muted">This webapp predicts happiness level of face from the uploaded photo.Enjoy predicting!</span>
20+
<span class="text-muted">This webapp predicts happiness level of the face from uploaded photo.Enjoy predicting!</span>
2421
</div>
2522
</div>
2623
<nav class="navbar sticky-top navbar-dark bg-primary">
@@ -54,34 +51,48 @@ <h1 class="text-muted">Google Cloud Platform - Face Detection Sample</h1>
5451

5552
<div class="row border border-primary m-1">
5653
<div class="col ">
54+
<!-- <form action="upload_photo" method="POST" enctype="multipart/form-data">
55+
Upload File: <input type="file" name="file"><br>
56+
<input type="submit" name="submit" value="Submit">
57+
</form> -->
58+
5759
<form class="p-1" action="upload_photo" method="POST" enctype="multipart/form-data">
5860
<div class="form-group">
5961
Upload Photo: <input id="file" type="file" accept="image/*" name="file" onchange="Filevalidation()"><br>
6062
</div>
6163

6264
<!-- <input type="file" accept="image/*" class="btn btn-primary mb-2" name="submit" value="Submit"> -->
63-
<button id="upload_button" type="submit" class="btn btn-primary mb-2">Confirm identity</button>
65+
<button id="upload_button" type="submit" class="btn btn-primary mb-2">Confirm identity</button>
6466
</form>
67+
6568
</div>
6669
</div>
6770

6871
<br>
72+
<h6>Uploads</h6>
73+
<div class="row m-2">
74+
6975

7076
{% for image_entity in image_entities %}
71-
<div class="row m-2">
72-
<div class="card">
73-
<img class="card-img-top img-thumbnail" src="{{image_entity['image_public_url']}}" alt="Card image cap">
74-
<div class="card-body">
75-
<h5 class="card-title">Joy Likelihood</h5>
76-
<p class="card-text badge badge-success"> {{image_entity['joy']}}</p>
77-
</div>
78-
<div class="card-footer">
79-
<small class="text-muted">{{image_entity['blob_name']}} was uploaded {{image_entity['timestamp']}}</small>
80-
</div>
81-
</div>
82-
</div>
77+
78+
79+
8380

81+
<div class="card m-1" style="width: 22rem;">
82+
<img class="card-img-top img-thumbnail" src="{{image_entity['image_public_url']}}" alt="Card image cap">
83+
<div class="card-body">
84+
<h5 class="card-title">Joy Likelihood</h5>
85+
<p class="card-text badge badge-success"> {{image_entity['joy']}}</p>
86+
</div>
87+
<div class="card-footer">
88+
<small class="text-muted">{{image_entity['blob_name']}} was uploaded {{image_entity['timestamp']}}</small>
89+
</div>
90+
</div>
91+
92+
8493
{% endfor %}
94+
</div>
95+
</div>
8596

8697
</div>
8798

@@ -96,7 +107,7 @@ <h5 class="card-title">Joy Likelihood</h5>
96107
const fsize = fi.files.item(i).size;
97108
const file = Math.round((fsize / 1024));
98109
// The size of the file.
99-
if (file >= 4096) {
110+
if (file >= 20000) {
100111
alert("File too Big, please select a file less than 4mb");
101112
uploadButton.disabled = true;
102113
} /*else if (file < 2048) {

0 commit comments

Comments
 (0)