Skip to content

Commit 4062a1e

Browse files
committed
Example page
1 parent 7362767 commit 4062a1e

File tree

7 files changed

+161
-4
lines changed

7 files changed

+161
-4
lines changed

app.py

+21
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,27 @@ def portrait():
6868

6969
return render_template('client/potrait.html',image_left=img_left,image_right=img_right,options = CONFIG['portrait'])
7070

71+
@app.route("/examples",methods=['GET','POST'])
72+
def example():
73+
epoch = str(22)
74+
if request.method == 'POST':
75+
epoch = request.form['epoch']
76+
epoch = str(min([32, int(epoch)]))
77+
path = 'http://www.cs.virginia.edu/~ks6cq/cyclegan-1/output/cyclegan/exp_rgb2dep/20171202-023330/imgs/'
78+
img = str(0)
79+
print epoch
80+
populate_page = []
81+
image_types = ['input','fake','cyc']
82+
a2b = ['A','B']
83+
for i in range(0,20):
84+
list_of_images=[]
85+
for img_type in image_types:
86+
for j in a2b:
87+
image = path+img_type+j+'_'+epoch+'_'+str(i)+'.jpg'
88+
list_of_images.append(image)
89+
populate_page.append(list_of_images)
90+
return render_template('client/example.html',path = populate_page)
91+
7192

7293
if __name__ == "__main__":
7394
development = CONFIG['development']

config.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
CONFIG = {
2-
'development': False,
3-
'default_model': 'siva.h5',
4-
'host': '128.143.63.199',
5-
'port': 8010,
2+
'development': True,
3+
'host': 'localhost',
4+
'port': 5000,
65
'pix2depth':{
76
'first_option':'pix2pix',
87
'second_option':'CycleGAN',

static/vendor/bootstrap/css/main.css

+24
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,28 @@ img{
88
border: 2px solid;
99
padding: 2px;
1010
margin: 15px;
11+
}
12+
13+
#example_img{
14+
height:250px;
15+
width:160px;
16+
}
17+
h2{
18+
font-family: verdana;
19+
text-transform: uppercase;
20+
font-size: 18px;
21+
}
22+
23+
h1{
24+
font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
25+
font-size: 45px;
26+
padding: 10px 10px;
27+
text-align: center;
28+
text-transform: uppercase;
29+
text-rendering: optimizeLegibility;
30+
31+
}
32+
#header{
33+
background-color: #d3e5f2;
34+
margin: 3px; padding: 3px;
1135
}

templates/client/depth.html

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<li class="nav-item">
3838
<a class="nav-link" href="portrait">Portrait Mode</a>
3939
</li>
40+
<li class="nav-item">
41+
<a class="nav-link" href="examples">Examples</a>
42+
</li>
4043
</ul>
4144
</div>
4245
</div>

templates/client/example.html

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
6+
<meta charset="utf-8">
7+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8+
<meta name="description" content="">
9+
<meta name="author" content="">
10+
11+
<title>Depth and RGB Estimator</title>
12+
13+
<!-- Bootstrap core CSS -->
14+
<link href="static/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
15+
<link rel="stylesheet" href="{{ url_for('static', filename='vendor/bootstrap/css/main.css') }}">
16+
17+
<!-- Custom styles for this template -->
18+
19+
20+
</head>
21+
22+
<body>
23+
24+
<!-- Navigation -->
25+
<nav class="navbar navbar-default navbar-fixed-top navbar-inverse">
26+
<div class="container">
27+
<div class="collapse navbar-collapse" id="navbarResponsive">
28+
<ul class="nav navbar-nav">
29+
<li class="nav-item">
30+
<a class="nav-link" href="/">Pix2Depth
31+
</a>
32+
</li>
33+
<li class="nav-item">
34+
<a class="nav-link" href="depth">Depth2Pix</a>
35+
</li>
36+
<li class="nav-item">
37+
<a class="nav-link" href="portrait">Portrait Mode</a>
38+
</li>
39+
<li class="nav-item active">
40+
<a class="nav-link" href="examples">Examples</a>
41+
<span class="sr-only">(current)</span>
42+
</li>
43+
</ul>
44+
</div>
45+
</div>
46+
</nav>
47+
48+
<!-- Page Content -->
49+
<div class="container" id="main-content">
50+
<div class="row">
51+
<div class="col-lg-12 text-center">
52+
<h1>Examples</h1>
53+
<form action="/examples" method="post" enctype="multipart/form-data">
54+
<div class="row">
55+
<span class="btn btn-default btn-file">
56+
<input type="text" name="epoch" placeholder="0 - 32">
57+
</span>
58+
<input type="submit" value="Show Epoch" class="btn btn-primary">
59+
</div>
60+
</form>
61+
<div class="container" id='header'>
62+
<div class="row">
63+
<div class='col-lg-2'>
64+
<h2>GT RGB</h2>
65+
66+
</div>
67+
<div class='col-lg-2'>
68+
<h2>GT Depth</h2>
69+
</div>
70+
<div class='col-lg-2'>
71+
<h2>Fake depth</h2>
72+
</div>
73+
<div class='col-lg-2'>
74+
<h2>Fake RGB</h2>
75+
</div>
76+
<div class='col-lg-2'>
77+
<h2>Cycle RGB</h2>
78+
</div>
79+
<div class='col-lg-2'>
80+
<h2>Cycle Depth</h2>
81+
</div>
82+
83+
</div>
84+
</div>
85+
<div class='container' style='overflow:scroll;height:500px;'>
86+
{% for list_images in path %}
87+
<div class="row">
88+
{% for images in list_images%}
89+
<img src="{{images}}" id='example_img'> {% endfor %}
90+
</div>
91+
{% endfor %}
92+
</div>
93+
94+
</div>
95+
</div>
96+
</div>
97+
98+
<!-- Bootstrap core JavaScript -->
99+
<script src="static/vendor/jquery/jquery.min.js"></script>
100+
<script src="static/vendor/bootstrap/js/bootstrap.js"></script>
101+
102+
</body>
103+
104+
</html>

templates/client/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<li class="nav-item">
3838
<a class="nav-link" href="portrait">Portrait Mode</a>
3939
</li>
40+
<li class="nav-item">
41+
<a class="nav-link" href="examples">Examples</a>
42+
</li>
4043
</ul>
4144
</div>
4245
</div>

templates/client/potrait.html

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
<a class="nav-link" href="portrait">Portrait Mode</a>
3838
<span class="sr-only">(current)</span>
3939
</li>
40+
<li class="nav-item">
41+
<a class="nav-link" href="examples">Examples</a>
42+
</li>
4043
</ul>
4144
</div>
4245
</div>

0 commit comments

Comments
 (0)