-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.html
160 lines (150 loc) · 5.5 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<html>
<head>
<meta charset="UTF-8">
<title>Fast Style Transfer Simple Example</title>
<link rel="stylesheet" type="text/css" href="./style.css">
<script src="libraries/p5.min.js"></script>
<script src="libraries/p5.dom.min.js"></script>
<script src="libraries/ml5.min.js"></script>
<style>
img {
width: 250px;
height: 250px;
}
</style>
</head>
<script src="sketch.js"></script>
<body>
<div class="body-container row">
<h1 class="center-text">Fast Style Transfer Example</h1>
<div class="input-container white-box col-3">
<h3 class="title">INPUT</h3>
<div class="center-container">
<img id="input-img" src='images/girlwithpearl.jpg'/>
<div id="input-source" class="reverse-img"></div>
</div>
<div class="style-container">
<div class="container">
<a class="imageAnchor" href="#" autofocus>
<img class="image" id="girlwithpearl" src='images/girlwithpearl.jpg' onclick="updateInputImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="starrynight" src='images/starrynight.jpg' onclick="updateInputImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="sunflower" src='images/sunflower.jpg' onclick="updateInputImg(this)"/>
</a>
</div>
</div>
<div class="style-container">
<div class="container">
<a class="imageAnchor" href="#" autofocus>
<img class="image" id="monalisa" src='images/monalisa.jpg' onclick="updateInputImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="sunday" src='images/sunday.jpg' onclick="updateInputImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="monet" src='images/monet.jpg' onclick="updateInputImg(this)"/>
</a>
</div>
</div>
<div class="style-container">
<input id="uploader" name="inputImgFile" type="file" accept="image/*">
<div class="link" onclick="uploadImg()">Upload an image</div>
<div class="link" onclick="useWebcam()">Use my webcam</div>
</div>
<div class="style-container">
<button class="start-btn" onclick="onPredictClick()">Transfer My Image / Video</button>
</div>
<div class="style-container">
<div class="note">
Click this button to start transfering your own image or video.<br>
If you are using webcam, you might need to wait for 3s / frame.
</div>
</div>
</div>
<div id="learning-container" class="white-box col-3">
<h3 class="title">STYLE</h3>
<div class="center-container">
<img id="style-img" src='images/wave.jpg'>
</div>
<div class="style-container">
<div class="container">
<a class="imageAnchor" href="#" autofocus>
<img class="image" id="wave" src='images/wave.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="la_muse" src='images/la_muse.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="rain_princess" src='images/rain_princess.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
</div>
<div class="style-container">
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="udnie" src='images/udnie.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="wreck" src='images/wreck.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="scream" src='images/scream.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
</div>
<div class="style-container">
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="fuchun" src='images/fuchun.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="zhangdaqian" src='images/zhangdaqian.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
<div class="container">
<a class="imageAnchor" href="#">
<img class="image" id="mathura" src='images/mathura.jpg' onclick="updateStyleImg(this)"/>
</a>
</div>
</div>
</div>
<div class="white-box output-container col-3">
<h3 class="title">OUTPUT</h3>
<div id="output-img-container"></div>
</div>
</div>
<div class="credits">
<div>
Built by <a href="https://1023/io" target="_blank">Yining Shi</a> with <a href="https://github.com/ITPNYU/ml5-js/" target="_blank">ML5</a>.
View
<a href="https://github.com/yining1023/fast_style_transfer_in_ML5/" target="_blank">
Code
</a> on GitHub.
</div>
<div>
Credits: The code and models are based on <a href="https://github.com/PAIR-code/deeplearnjs/tree/0608feadbd897bca6ec7abf3340515fe5f2de1c2/demos/fast-style-transfer" target="_blank">deeplearn.js demo</a> by <a href="https://github.com/reiinakano" target="_blank">reiinakano</a>
</div>
</div>
</body>
</html>