-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
123 lines (111 loc) · 3.86 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Caffe demos">
<meta name="author" content="BVLC (http://bvlc.eecs.berkeley.edu/)">
<title>Crowd Counting</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- Script to instantly classify an image once it is uploaded. -->
<script type="text/javascript">
$(document).ready(
function(){
$('#classifyfile').attr('disabled',true);
$('#imagefile').change(
function(){
if ($(this).val()){
$('#formupload').submit();
}
}
);
}
);
</script>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height:1.5em;
color: #232323;
-webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
font-family: Times, serif;
line-height:1.5em;
border-bottom: 1px solid #ccc;
}
h4 {
text-align: center;
}
cent {
margin:0px auto;
}
</style>
</head>
<body>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1><a href="/">CRowd Counting</a></h1>
<p>
The <a href="http://caffe.berkeleyvision.org">Caffe</a> neural network library makes implementing state-of-the-art computer vision systems easy.
</p>
</div>
<div>
<h2>Classification</h2>
<!--<a href="/classify_url?imageurl=http%3A%2F%2Fi.telegraph.co.uk%2Fmultimedia%2Farchive%2F02351%2Fcross-eyed-cat_2351472k.jpg">Click for a Quick Example</a> -->
</div>
{% if has_result %}
{% if not result[0] %}
<!-- we have error in the result. -->
<div class="alert alert-danger">{{ result[1] }} Did you provide a valid URL or a valid image file? </div>
{% else %}
<div class="media">
<a class="pull-left" href="#"><img class="media-object" width="192" height="192" src={{imagesrc}}></a>
<div class="media-body">
<div class="media">
<div class="cent">
<a class="pull-left" href="#"><img class="media-object" width="192" height="192" src={{imagedst}}></a>
<div class="media-body">
<div class="media">
<h4> number of people: {{result[2]}} </h4>
</div>
</div>
</div>
</div>
</div>
</div>
<p> CNN took {{ result[3] }} seconds. </p>
{% endif %}
<hr>
{% endif %}
<!--
<form role="form" action="classify_url" method="get">
<div class="form-group">
<div class="input-group">
<input type="text" class="form-control" name="imageurl" id="imageurl" placeholder="Provide an image URL">
<span class="input-group-btn">
<input class="btn btn-primary" value="Classify URL" type="submit" id="classifyurl"></input>
</span>
</div>
</div>
</form>
-->
<form id="formupload" class="form-inline" role="form" action="classify_upload" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="imagefile">Or upload an image:</label>
<input type="file" name="imagefile" id="imagefile">
</div>
<!--<input type="submit" class="btn btn-primary" value="Classify File" id="classifyfile"></input>-->
</form>
</div>
<hr>
<div id="footer">
<div class="container">
<p>© MUSTDL 2017</p>
</div>
</div>
</body>
</html>